[Lldb-commits] [lldb] r148379 - /lldb/trunk/test/dotest.py

Johnny Chen johnny.chen at apple.com
Tue Jan 17 21:15:00 PST 2012


Author: johnny
Date: Tue Jan 17 23:15:00 2012
New Revision: 148379

URL: http://llvm.org/viewvc/llvm-project?rev=148379&view=rev
Log:
Add a '-X excluded-dir' option to the test driver to exclude a directory from consideration during test discovery.  For example:

    ./dotest.py -X types -v

from the test dir will ignore test cases under test/types.

Modified:
    lldb/trunk/test/dotest.py

Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=148379&r1=148378&r2=148379&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Tue Jan 17 23:15:00 2012
@@ -110,6 +110,9 @@
 # The benchamrk iteration count, as specified by the '-y' option.
 bmIterationCount = -1
 
+# By default, don't exclude any directories.  Use '-X' to add one excluded directory.
+excluded = set(['.svn', '.git'])
+
 # By default, failfast is False.  Use '-F' to overwrite it.
 failfast = False
 
@@ -227,6 +230,9 @@
        timestamp as the session dir name
 -t   : turn on tracing of lldb command and other detailed test executions
 -v   : do verbose mode of unittest framework (print out each test case invocation)
+-X   : exclude a directory from consideration for test discovery
+       -X types => if 'types' appear in the pathname components of a potential testfile
+                   it will be ignored
 -x   : specify the breakpoint specification for the benchmark executable;
        see also '-e', which provides the full path of the executable
 -y   : specify the iteration count used to collect our benchmarks; an example is
@@ -503,6 +509,13 @@
         elif sys.argv[index].startswith('-w'):
             os.environ["LLDB_WAIT_BETWEEN_TEST_CASES"] = 'YES'
             index += 1
+        elif sys.argv[index].startswith('-X'):
+            # Increment by 1 to fetch an excluded directory.
+            index += 1
+            if index >= len(sys.argv):
+                usage()
+            excluded.add(sys.argv[index])
+            index += 1
         elif sys.argv[index].startswith('-x'):
             # Increment by 1 to fetch the breakpoint specification of the benchmark executable.
             index += 1
@@ -781,6 +794,11 @@
     global regexp
     global filters
     global fs4all
+    global excluded
+
+    if set(dir.split(os.sep)).intersection(excluded):
+        #print "Detected an excluded dir component: %s" % dir
+        return
 
     for name in names:
         if os.path.isdir(os.path.join(dir, name)):





More information about the lldb-commits mailing list