Johnny Chen | 7737777 | 2010-09-07 17:06:13 +0000 | [diff] [blame] | 1 | """ |
| 2 | Test lldb settings command. |
| 3 | """ |
| 4 | |
| 5 | import os, time |
| 6 | import unittest2 |
| 7 | import lldb |
| 8 | from lldbtest import * |
| 9 | |
| 10 | class SettingsCommandTestCase(TestBase): |
| 11 | |
| 12 | mydir = "settings" |
| 13 | |
| 14 | def test_set_prompt(self): |
| 15 | """Test that 'set prompt' actually changes the prompt.""" |
Johnny Chen | 881c371 | 2010-09-07 17:12:10 +0000 | [diff] [blame^] | 16 | |
| 17 | # Use '-o' option to override the existing instance setting. |
Johnny Chen | 7737777 | 2010-09-07 17:06:13 +0000 | [diff] [blame] | 18 | self.runCmd("settings set -o prompt 'lldb2'") |
Johnny Chen | 881c371 | 2010-09-07 17:12:10 +0000 | [diff] [blame^] | 19 | |
| 20 | # Immediately test the setting. |
Johnny Chen | 7737777 | 2010-09-07 17:06:13 +0000 | [diff] [blame] | 21 | self.expect("settings show prompt", |
| 22 | startstr = "prompt (string) = 'lldb2'") |
Johnny Chen | 881c371 | 2010-09-07 17:12:10 +0000 | [diff] [blame^] | 23 | |
| 24 | # The overall display should also reflect the new setting. |
Johnny Chen | 7737777 | 2010-09-07 17:06:13 +0000 | [diff] [blame] | 25 | self.expect("settings show", |
| 26 | substrs = ["prompt (string) = 'lldb2'"]) |
| 27 | |
| 28 | |
| 29 | if __name__ == '__main__': |
| 30 | import atexit |
| 31 | lldb.SBDebugger.Initialize() |
| 32 | atexit.register(lambda: lldb.SBDebugger.Terminate()) |
| 33 | unittest2.main() |