[lldb-dev] [PATCH] Emit message in test driver if not running multithreaded

Steve Pucci spucci at google.com
Thu Mar 13 15:16:42 PDT 2014


Hi all,

The gain in speed from running dosep.ty (the main lldb test driver) is
large, but turning it on requires an environment variable and so is hard
for users to discover.

To let people know about it, I'd like to commit the attached patch which
will print a message if the environment variable is unset (or is set to 1):

        print "NOT running multithreaded.  Consider setting
LLDB_TEST_THREADS environment variable."

Thanks,
   Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140313/e94ca471/attachment.html>
-------------- next part --------------
Index: test/dosep.ty
===================================================================
--- test/dosep.ty	(revision 203849)
+++ test/dosep.ty	(working copy)
@@ -12,6 +12,8 @@
 # Command template of the invocation of the test driver.
 template = '%s/dotest.py %s -p %s %s'
 
+multithreaded_envar = 'LLDB_TEST_THREADS'
+
 def process_dir(root, files, test_root, dotest_options):
     """Examine a directory for tests, and invoke any found within it."""
     failed = []
@@ -54,7 +56,7 @@
     failed = []
     passed = []
     if (num_threads > 1):
-        print "Running multithreaded with " + str(num_threads) + " threads."
+        print "Running multithreaded with " + str(num_threads) + " threads (from " + multithreaded_envar + ")"
         global in_q
         global out_q
         in_q = Queue.Queue()
@@ -63,6 +65,8 @@
             t = threading.Thread(target=process_dir_worker)
             t.daemon = True
             t.start()
+    else:
+        print "NOT running multithreaded.  Consider setting " + multithreaded_envar + " environment variable."
     for root, dirs, files in os.walk(test_root, topdown=False):
         if (num_threads > 1):
             in_q.put((root, files, test_root, dotest_options))
Index: test/source-manager/main.c
===================================================================
--- test/source-manager/main.c	(revision 203849)
+++ test/source-manager/main.c	(working copy)
@@ -1,6 +0,0 @@
-#include <stdio.h>
-
-int main(int argc, char const *argv[]) {
-    printf("Hello world.\n"); // Set break point at this line.
-    return 0;
-}


More information about the lldb-dev mailing list