Add a @benchmarks_test decorator for test method we want to categorize as benchmarks test.
The test driver now takes an option "+b" which enables to run just the benchmarks tests.
By default, tests decorated with the @benchmarks_test decorator do not get run.
Add an example benchmarks test directory which contains nothing for the time being,
just to demonstrate the @benchmarks_test concept.
For example,
$ ./dotest.py -v benchmarks
...
----------------------------------------------------------------------
Collected 2 tests
1: test_with_gdb (TestRepeatedExprs.RepeatedExprssCase)
Test repeated expressions with gdb. ... skipped 'benchmarks tests'
2: test_with_lldb (TestRepeatedExprs.RepeatedExprssCase)
Test repeated expressions with lldb. ... skipped 'benchmarks tests'
----------------------------------------------------------------------
Ran 2 tests in 0.047s
OK (skipped=2)
$ ./dotest.py -v +b benchmarks
...
----------------------------------------------------------------------
Collected 2 tests
1: test_with_gdb (TestRepeatedExprs.RepeatedExprssCase)
Test repeated expressions with gdb. ... running test_with_gdb
benchmarks result for test_with_gdb
ok
2: test_with_lldb (TestRepeatedExprs.RepeatedExprssCase)
Test repeated expressions with lldb. ... running test_with_lldb
benchmarks result for test_with_lldb
ok
----------------------------------------------------------------------
Ran 2 tests in 0.270s
OK
Also mark some Python API tests which are missing the @python_api_test decorator.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136553 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/dotest.py b/test/dotest.py
index 68cca8c..f422bc5 100755
--- a/test/dotest.py
+++ b/test/dotest.py
@@ -70,6 +70,9 @@
# By default, both command line and Python API tests are performed.
just_do_python_api_test = False
+# By default, benchmarks tests are not run.
+just_do_benchmarks_test = False
+
# The blacklist is optional (-b blacklistFile) and allows a central place to skip
# testclass's and/or testclass.testmethod's.
blacklist = None
@@ -162,6 +165,8 @@
use @python_api_test to decorate a test case as lldb Python API test
+a : just do lldb Python API tests
do not specify both '-a' and '+a' at the same time
++b : just do benchmark tests
+ use @benchmark_test to decorate a test case as such
-b : read a blacklist file specified after this option
-c : read a config file specified after this option
the architectures and compilers (note the plurals) specified via '-A' and '-C'
@@ -287,6 +292,7 @@
global dont_do_python_api_test
global just_do_python_api_test
+ global just_do_benchmarks_test
global blacklist
global blacklistConfig
global configFile
@@ -347,6 +353,9 @@
elif sys.argv[index].startswith('+a'):
just_do_python_api_test = True
index += 1
+ elif sys.argv[index].startswith('+b'):
+ just_do_benchmarks_test = True
+ index += 1
elif sys.argv[index].startswith('-b'):
# Increment by 1 to fetch the blacklist file name option argument.
index += 1
@@ -815,6 +824,7 @@
# Put dont/just_do_python_api_test in the lldb namespace, too.
lldb.dont_do_python_api_test = dont_do_python_api_test
lldb.just_do_python_api_test = just_do_python_api_test
+lldb.just_do_benchmarks_test = just_do_benchmarks_test
# Turn on lldb loggings if necessary.
lldbLoggings()