Merge dwarf and dsym tests
Currently most of the test files have a separate dwarf and a separate
dsym test with almost identical content (only the build step is
different). With adding dwo symbol file handling to the test suit it
would increase this to a 3-way duplication. The purpose of this change
is to eliminate this redundancy with generating 2 test case (one dwarf
and one dsym) for each test function specified (dwo handling will be
added at a later commit).
Main design goals:
* There should be no boilerplate code in each test file to support the
multiple debug info in most of the tests (custom scenarios are
acceptable in special cases) so adding a new test case is easier and
we can't miss one of the debug info type.
* In case of a test failure, the debug symbols used during the test run
have to be cleanly visible from the output of dotest.py to make
debugging easier both from build bot logs and from local test runs
* Each test case should have a unique, fully qualified name so we can
run exactly 1 test with "-f <test-case>.<test-function>" syntax
* Test output should be grouped based on test files the same way as it
happens now (displaying dwarf/dsym results separately isn't
preferable)
Proposed solution (main logic in lldbtest.py, rest of them are test
cases fixed up for the new style):
* Have only 1 test fuction in the test files what will run for all
debug info separately and this test function should call just
"self.build(...)" to build an inferior with the right debug info
* When a class is created by python (the class object, not the class
instance), we will generate a new test method for each debug info
format in the test class with the name "<test-function>_<debug-info>"
and remove the original test method. This way unittest2 see multiple
test methods (1 for each debug info, pretty much as of now) and will
handle the test selection and the failure reporting correctly (the
debug info will be visible from the end of the test name)
* Add new annotation @no_debug_info_test to disable the generation of
multiple tests for each debug info format when the test don't have an
inferior
Differential revision: http://reviews.llvm.org/D13028
llvm-svn: 248883
diff --git a/lldb/test/settings/TestSettings.py b/lldb/test/settings/TestSettings.py
index 5083348..f430a9d 100644
--- a/lldb/test/settings/TestSettings.py
+++ b/lldb/test/settings/TestSettings.py
@@ -19,6 +19,7 @@
cls.RemoveTempFile("stderr.txt")
cls.RemoveTempFile("stdout.txt")
+ @no_debug_info_test
def test_apropos_should_also_search_settings_description(self):
"""Test that 'apropos' command should also search descriptions for the settings variables."""
@@ -27,6 +28,7 @@
"environment variables",
"executable's environment"])
+ @no_debug_info_test
def test_append_target_env_vars(self):
"""Test that 'append target.run-args' works."""
# Append the env-vars.
@@ -39,6 +41,7 @@
self.expect('settings show target.env-vars',
substrs = ['MY_ENV_VAR=YES'])
+ @no_debug_info_test
def test_insert_before_and_after_target_run_args(self):
"""Test that 'insert-before/after target.run-args' works."""
# Set the run-args first.
@@ -60,6 +63,7 @@
'[3]: "b"',
'[4]: "c"'])
+ @no_debug_info_test
def test_replace_target_run_args(self):
"""Test that 'replace target.run-args' works."""
# Set the run-args and then replace the index-0 element.
@@ -77,6 +81,7 @@
'[1]: "b"',
'[2]: "c"'])
+ @no_debug_info_test
def test_set_prompt(self):
"""Test that 'set prompt' actually changes the prompt."""
@@ -94,6 +99,7 @@
# Use '-r' option to reset to the original default prompt.
self.runCmd("settings clear prompt")
+ @no_debug_info_test
def test_set_term_width(self):
"""Test that 'set term-width' actually changes the term-width."""
@@ -110,7 +116,7 @@
#rdar://problem/10712130
def test_set_frame_format(self):
"""Test that 'set frame-format' with a backtick char in the format string works as well as fullpath."""
- self.buildDefault()
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -143,7 +149,7 @@
def test_set_auto_confirm(self):
"""Test that after 'set auto-confirm true', manual confirmation should not kick in."""
- self.buildDefault()
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -168,7 +174,7 @@
@skipUnlessArch(['x86_64', 'i386', 'i686'])
def test_disassembler_settings(self):
"""Test that user options for the disassembler take effect."""
- self.buildDefault()
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -199,22 +205,10 @@
self.expect("disassemble -n numberfn",
substrs = ["5ah"])
- @skipUnlessDarwin
- @dsym_test
- def test_run_args_and_env_vars_with_dsym(self):
- """Test that run-args and env-vars are passed to the launched process."""
- self.buildDsym()
- self.pass_run_args_and_env_vars()
-
- @dwarf_test
@expectedFailureWindows("llvm.org/pr24579")
- def test_run_args_and_env_vars_with_dwarf(self):
+ def test_run_args_and_env_vars(self):
"""Test that run-args and env-vars are passed to the launched process."""
- self.buildDwarf()
- self.pass_run_args_and_env_vars()
-
- def pass_run_args_and_env_vars(self):
- """Test that run-args and env-vars are passed to the launched process."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -244,7 +238,7 @@
@skipIfRemote # it doesn't make sense to send host env to remote target
def test_pass_host_env_vars(self):
"""Test that the host env vars are passed to the launched process."""
- self.buildDefault()
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -277,7 +271,7 @@
def test_set_error_output_path(self):
"""Test that setting target.error/output-path for the launched process works."""
- self.buildDefault()
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -328,6 +322,7 @@
self.expect(output, exe=False,
startstr = "This message should go to standard out.")
+ @no_debug_info_test
def test_print_dictionary_setting(self):
self.runCmd ("settings clear target.env-vars")
self.runCmd ("settings set target.env-vars [\"MY_VAR\"]=some-value")
@@ -335,6 +330,7 @@
substrs = [ "MY_VAR=some-value" ])
self.runCmd ("settings clear target.env-vars")
+ @no_debug_info_test
def test_print_array_setting(self):
self.runCmd ("settings clear target.run-args")
self.runCmd ("settings set target.run-args gobbledy-gook")
@@ -342,6 +338,7 @@
substrs = [ '[0]: "gobbledy-gook"' ])
self.runCmd ("settings clear target.run-args")
+ @no_debug_info_test
def test_settings_with_quotes (self):
self.runCmd ("settings clear target.run-args")
self.runCmd ("settings set target.run-args a b c")
@@ -368,6 +365,7 @@
self.expect ("settings show thread-format", 'thread-format (format-string) = "abc def "')
self.runCmd ('settings clear thread-format')
+ @no_debug_info_test
def test_settings_with_trailing_whitespace (self):
# boolean
@@ -450,6 +448,7 @@
substrs = [ 'disassembly-format (format-string) = "foo "'])
self.runCmd("settings clear disassembly-format", check=False)
+ @no_debug_info_test
def test_all_settings_exist (self):
self.expect ("settings show",
substrs = [ "auto-confirm",