summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-10-11 01:30:27 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-10-11 01:30:27 +0000
commit999f7ab9bd390b0cb9a5090c61e76e82b45f1f7a (patch)
tree5037b575192d5fc991a734b8d0a51c52b884d39d
parent2dd7f7fb71440fdc96a418160df21170a9881861 (diff)
downloadbcm5719-llvm-999f7ab9bd390b0cb9a5090c61e76e82b45f1f7a.tar.gz
bcm5719-llvm-999f7ab9bd390b0cb9a5090c61e76e82b45f1f7a.zip
Add '-k' option to the test driver to be able to specify a runhook, which is an lldb command
for the debugger to execute for certain kind of tests (for example, a benchmark). A list of runhooks can be used to steer the debugger into the desired state before more actions can be performed. llvm-svn: 141626
-rwxr-xr-xlldb/test/dotest.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py
index 93ec4f488fc..1e412ff9cb9 100755
--- a/lldb/test/dotest.py
+++ b/lldb/test/dotest.py
@@ -114,6 +114,10 @@ failfast = False
# The filters (testclass.testmethod) used to admit tests into our test suite.
filters = []
+# The runhooks is a list of lldb commands specifically for the debugger.
+# Use '-k' to specify a runhook.
+runHooks = []
+
# If '-g' is specified, the filterspec is not exclusive. If a test module does
# not contain testclass.testmethod which matches the filterspec, the whole test
# module is still admitted into our test suite. fs4all flag defaults to True.
@@ -190,6 +194,10 @@ where options:
still admitted to the test suite
-i : ignore (don't bailout) if 'lldb.py' module cannot be located in the build
tree relative to this script; use PYTHONPATH to locate the module
+-k : specify a runhook, which is an lldb command to be executed by the debugger;
+ '-k' option can occur multiple times, the commands are executed one after the
+ other to bring the debugger to a desired state, so that, for example, further
+ benchmarking can be done
-l : don't skip long running test
-p : specify a regexp filename pattern for inclusion in the test suite
-r : specify a dir to relocate the tests and their intermediate files to;
@@ -317,6 +325,7 @@ def parseOptionsAndInitTestdirs():
global filters
global fs4all
global ignore
+ global runHooks
global skipLongRunningTest
global regexp
global rdir
@@ -419,6 +428,13 @@ def parseOptionsAndInitTestdirs():
elif sys.argv[index].startswith('-i'):
ignore = True
index += 1
+ elif sys.argv[index].startswith('-k'):
+ # Increment by 1 to fetch the runhook lldb command.
+ index += 1
+ if index >= len(sys.argv) or sys.argv[index].startswith('-'):
+ usage()
+ runHooks.append(sys.argv[index])
+ index += 1
elif sys.argv[index].startswith('-l'):
skipLongRunningTest = False
index += 1
@@ -890,6 +906,9 @@ lldb.just_do_benchmarks_test = just_do_benchmarks_test
lldb.bmExecutable = bmExecutable
lldb.bmBreakpointSpec = bmBreakpointSpec
+# And don't forget the runHooks!
+lldb.runHooks = runHooks
+
# Turn on lldb loggings if necessary.
lldbLoggings()
OpenPOWER on IntegriCloud