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.

llvm-svn: 137540
This commit is contained in:
Johnny Chen 2011-08-12 23:55:07 +00:00
parent 58b662c3e3
commit 60726fab78
1 changed files with 7 additions and 8 deletions

View File

@ -717,21 +717,20 @@ def visit(prefix, dir, names):
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.