Add a new option to the test driver, -N dsym or -N dwarf, in order to exclude tests decorated with
either @dsym_test or @dwarf_test to be executed during the testsuite run. There are still lots of
Test*.py files which have not been decorated with the new decorator.
An example:
# From TestMyFirstWatchpoint.py ->
class HelloWatchpointTestCase(TestBase):
mydir = os.path.join("functionalities", "watchpoint", "hello_watchpoint")
@dsym_test
def test_hello_watchpoint_with_dsym_using_watchpoint_set(self):
"""Test a simple sequence of watchpoint creation and watchpoint hit."""
self.buildDsym(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.hello_watchpoint()
@dwarf_test
def test_hello_watchpoint_with_dwarf_using_watchpoint_set(self):
"""Test a simple sequence of watchpoint creation and watchpoint hit."""
self.buildDwarf(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.hello_watchpoint()
# Invocation ->
[17:50:14] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-137
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 154133
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 154109
Last Changed Date: 2012-04-05 10:43:02 -0700 (Thu, 05 Apr 2012)
Session logs for test failures/errors/unexpected successes will go into directory '2012-04-05-17_50_49'
Command invoked: python ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
compilers=['clang']
Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 2 tests
1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
Test a simple sequence of watchpoint creation and watchpoint hit. ... skipped 'dsym tests'
2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
Test a simple sequence of watchpoint creation and watchpoint hit. ... ok
----------------------------------------------------------------------
Ran 2 tests in 1.138s
OK (skipped=1)
Session logs for test failures/errors/unexpected successes can be found in directory '2012-04-05-17_50_49'
[17:50:50] johnny:/Volumes/data/lldb/svn/ToT/test $
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154154 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/dotest.py b/test/dotest.py
index d9d508e..4a2e1bf 100755
--- a/test/dotest.py
+++ b/test/dotest.py
@@ -74,6 +74,13 @@
# By default, benchmarks tests are not run.
just_do_benchmarks_test = False
+# By default, both dsym and dwarf tests are performed.
+# Use @dsym_test or @dwarf_test decorators, defined in lldbtest.py, to mark a test
+# as a dsym or dwarf test. Use '-N dsym' or '-N dwarf' to exclude dsym or dwarf
+# tests from running.
+dont_do_dsym_test = False
+dont_do_dwarf_test = False
+
# The blacklist is optional (-b blacklistFile) and allows a central place to skip
# testclass's and/or testclass.testmethod's.
blacklist = None
@@ -199,6 +206,8 @@
inferior programs to be debugged
suggestions: do not lump the -A arch1^arch2 together such that the -E
option applies to only one of the architectures
+-N : don't do test cases marked with the @dsym decorator by passing 'dsym' as the option arg, or
+ don't do test cases marked with the @dwarf decorator by passing 'dwarf' as the option arg
-a : don't do lldb Python API tests
use @python_api_test to decorate a test case as lldb Python API test
+a : just do lldb Python API tests
@@ -353,6 +362,8 @@
global dont_do_python_api_test
global just_do_python_api_test
global just_do_benchmarks_test
+ global dont_do_dsym_test
+ global dont_do_dwarf_test
global blacklist
global blacklistConfig
global configFile
@@ -423,6 +434,21 @@
cflags_extras = sys.argv[index]
os.environ["CFLAGS_EXTRAS"] = cflags_extras
index += 1
+ elif sys.argv[index].startswith('-N'):
+ # Increment by 1 to fetch 'dsym' or 'dwarf'.
+ index += 1
+ if index >= len(sys.argv) or sys.argv[index].startswith('-'):
+ usage()
+ dont_do = sys.argv[index]
+ if dont_do.lower() == 'dsym':
+ dont_do_dsym_test = True
+ elif dont_do.lower() == 'dwarf':
+ dont_do_dwarf_test = True
+ else:
+ print "!!!"
+ print "Warning: -N only accepts either 'dsym' or 'dwarf' as the option arg; you passed in '%s'?" % dont_do
+ print "!!!"
+ index += 1
elif sys.argv[index].startswith('-a'):
dont_do_python_api_test = True
index += 1
@@ -995,10 +1021,12 @@
# Put the blacklist in the lldb namespace, to be used by lldb.TestBase.
lldb.blacklist = blacklist
-# Put dont/just_do_python_api_test in the lldb namespace.
+# Put all these test decorators in the lldb namespace.
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
+lldb.dont_do_dsym_test = dont_do_dsym_test
+lldb.dont_do_dwarf_test = dont_do_dwarf_test
# Do we need to skip build and cleanup?
lldb.skip_build_and_cleanup = skip_build_and_cleanup