Fix a test driver bug where multiple filter specs (through the -f TestClassName.test_method_name
command line option) belonging to the same Test*.py file are ignored, except for the first one.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137540 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/dotest.py b/test/dotest.py
index f71bdde..003a494 100755
--- a/test/dotest.py
+++ b/test/dotest.py
@@ -717,21 +717,20 @@
filtered = False
break
- # If we reach here, we have a good filterspec. Add it.
+ # If filtered, we have a good filterspec. Add it.
if filtered:
- break
+ #print "adding filter spec %s to module %s" % (filterspec, module)
+ suite.addTests(
+ unittest2.defaultTestLoader.loadTestsFromName(filterspec, module))
+ continue
# Forgo this module if the (base, filterspec) combo is invalid
# and no '-g' option is specified
if filters and fs4all and not filtered:
continue
- # Add either the filtered test case or the entire test class.
- if filterspec and filtered:
- #print "adding filter spec %s to module %s" % (filterspec, module)
- suite.addTests(
- unittest2.defaultTestLoader.loadTestsFromName(filterspec, module))
- else:
+ # Add either the filtered test case(s) (which is done before) or the entire test class.
+ if not filterspec or not filtered:
# A simple case of just the module name. Also the failover case
# from the filterspec branch when the (base, filterspec) combo
# doesn't make sense.