diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-10-18 17:51:45 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-10-18 17:51:45 +0000 |
commit | 3e9c50c7c00f1e3cc224bb3565195ad71bfba47f (patch) | |
tree | e0ced9c9fad18828c0bcd8300929129009a2e9f7 /lldb/test/settings | |
parent | f34011e4ca0f5635b99ff315ac10206a2d40ce62 (diff) | |
download | bcm5719-llvm-3e9c50c7c00f1e3cc224bb3565195ad71bfba47f.tar.gz bcm5719-llvm-3e9c50c7c00f1e3cc224bb3565195ad71bfba47f.zip |
Add a case to test that after 'set auto-confirm true', manual confirmation should not kick in.
Also add a more useful assert message for test_set_output_path(), which is currently decorated
with @expectedFailure.
llvm-svn: 116718
Diffstat (limited to 'lldb/test/settings')
-rw-r--r-- | lldb/test/settings/TestSettings.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lldb/test/settings/TestSettings.py b/lldb/test/settings/TestSettings.py index eb072135ce2..9682a67568e 100644 --- a/lldb/test/settings/TestSettings.py +++ b/lldb/test/settings/TestSettings.py @@ -47,6 +47,31 @@ class SettingsCommandTestCase(TestBase): self.expect("settings show", substrs = ["term-width (int) = '70'"]) + def test_set_auto_confirm(self): + """Test that after 'set auto-confirm true', manual confirmation should not kick in.""" + self.buildDefault() + + exe = os.path.join(os.getcwd(), "a.out") + self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) + + # No '-o' option is needed for static setting. + self.runCmd("settings set auto-confirm true") + + # Immediately test the setting. + self.expect("settings show auto-confirm", + startstr = "auto-confirm (boolean) = 'true'") + + # Now 'breakpoint delete' should just work fine without confirmation + # prompt from the command interpreter. + self.runCmd("breakpoint set -n main") + self.expect("breakpoint delete", + startstr = "All breakpoints removed") + + # Restore the original setting of auto-confirm. + self.runCmd("settings set -r auto-confirm") + self.expect("settings show auto-confirm", + startstr = "auto-confirm (boolean) = 'false'") + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): """Test that run-args and env-vars are passed to the launched process.""" @@ -96,6 +121,10 @@ class SettingsCommandTestCase(TestBase): self.runCmd("run", RUN_SUCCEEDED) + # The 'stdout.txt' file should now exist. + self.assertTrue(os.path.isfile("stdout.txt"), + "'stdout.txt' exists due to target.process.output-path.") + # Read the output file produced by running the program. with open('stdout.txt', 'r') as f: output = f.read() |