forked from OSchip/llvm-project
Add an option '-# count' to run the specified test suite for a said number of times.
This is not to be used during normal test suite run, but to be used to stress test specific test sequences repeatedly. Example: ./dotest.py -# 3 -v breakpoint_conditions will repeat the test suite 3 times for tests under the breakpoint_conditions directory. llvm-svn: 119399
This commit is contained in:
parent
44c2241cd4
commit
ecb072d840
|
@ -48,6 +48,9 @@ suite = unittest2.TestSuite()
|
||||||
# The config file is optional.
|
# The config file is optional.
|
||||||
configFile = None
|
configFile = None
|
||||||
|
|
||||||
|
# Test suite repeat count. Can be overwritten with '-# count'.
|
||||||
|
count = 1
|
||||||
|
|
||||||
# The dictionary as a result of sourcing configFile.
|
# The dictionary as a result of sourcing configFile.
|
||||||
config = {}
|
config = {}
|
||||||
|
|
||||||
|
@ -122,6 +125,7 @@ where options:
|
||||||
-t : trace lldb command execution and result
|
-t : trace lldb command execution and result
|
||||||
-v : do verbose mode of unittest framework
|
-v : do verbose mode of unittest framework
|
||||||
-w : insert some wait time (currently 0.5 sec) between consecutive test cases
|
-w : insert some wait time (currently 0.5 sec) between consecutive test cases
|
||||||
|
-# : Repeat the test suite for a specified number of times
|
||||||
|
|
||||||
and:
|
and:
|
||||||
args : specify a list of directory names to search for test modules named after
|
args : specify a list of directory names to search for test modules named after
|
||||||
|
@ -216,6 +220,7 @@ def parseOptionsAndInitTestdirs():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
global configFile
|
global configFile
|
||||||
|
global count
|
||||||
global delay
|
global delay
|
||||||
global filterspec
|
global filterspec
|
||||||
global fs4all
|
global fs4all
|
||||||
|
@ -301,6 +306,13 @@ def parseOptionsAndInitTestdirs():
|
||||||
elif sys.argv[index].startswith('-w'):
|
elif sys.argv[index].startswith('-w'):
|
||||||
os.environ["LLDB_WAIT_BETWEEN_TEST_CASES"] = 'YES'
|
os.environ["LLDB_WAIT_BETWEEN_TEST_CASES"] = 'YES'
|
||||||
index += 1
|
index += 1
|
||||||
|
elif sys.argv[index].startswith('-#'):
|
||||||
|
# Increment by 1 to fetch the repeat count argument.
|
||||||
|
index += 1
|
||||||
|
if index >= len(sys.argv) or sys.argv[index].startswith('-'):
|
||||||
|
usage()
|
||||||
|
count = int(sys.argv[index])
|
||||||
|
index += 1
|
||||||
else:
|
else:
|
||||||
print "Unknown option: ", sys.argv[index]
|
print "Unknown option: ", sys.argv[index]
|
||||||
usage()
|
usage()
|
||||||
|
@ -709,7 +721,7 @@ for ia in range(len(archs) if iterArchs else 1):
|
||||||
|
|
||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
if LLDBTestResult.__singleton__:
|
if LLDBTestResult.__singleton__:
|
||||||
raise "LLDBTestResult instantiated more than once"
|
raise Exception("LLDBTestResult instantiated more than once")
|
||||||
super(LLDBTestResult, self).__init__(*args)
|
super(LLDBTestResult, self).__init__(*args)
|
||||||
LLDBTestResult.__singleton__ = self
|
LLDBTestResult.__singleton__ = self
|
||||||
# Now put this singleton into the lldb module namespace.
|
# Now put this singleton into the lldb module namespace.
|
||||||
|
@ -740,8 +752,12 @@ for ia in range(len(archs) if iterArchs else 1):
|
||||||
method()
|
method()
|
||||||
|
|
||||||
# Invoke the test runner.
|
# Invoke the test runner.
|
||||||
result = unittest2.TextTestRunner(stream=sys.stderr, verbosity=verbose,
|
if count == 1:
|
||||||
resultclass=LLDBTestResult).run(suite)
|
result = unittest2.TextTestRunner(stream=sys.stderr, verbosity=verbose,
|
||||||
|
resultclass=LLDBTestResult).run(suite)
|
||||||
|
else:
|
||||||
|
for i in range(count):
|
||||||
|
result = unittest2.TextTestRunner(stream=sys.stderr, verbosity=verbose).run(suite)
|
||||||
|
|
||||||
|
|
||||||
if sdir_has_content:
|
if sdir_has_content:
|
||||||
|
|
Loading…
Reference in New Issue