blob: 35b12f98e2d48a678560c160c29cfd1b008400e4 [file] [log] [blame]
Johnny Chen77377772010-09-07 17:06:13 +00001"""
2Test lldb settings command.
3"""
4
5import os, time
6import unittest2
7import lldb
8from lldbtest import *
9
10class SettingsCommandTestCase(TestBase):
11
12 mydir = "settings"
13
14 def test_set_prompt(self):
15 """Test that 'set prompt' actually changes the prompt."""
Johnny Chen881c3712010-09-07 17:12:10 +000016
17 # Use '-o' option to override the existing instance setting.
Johnny Chen77377772010-09-07 17:06:13 +000018 self.runCmd("settings set -o prompt 'lldb2'")
Johnny Chen881c3712010-09-07 17:12:10 +000019
20 # Immediately test the setting.
Johnny Chen77377772010-09-07 17:06:13 +000021 self.expect("settings show prompt",
22 startstr = "prompt (string) = 'lldb2'")
Johnny Chen881c3712010-09-07 17:12:10 +000023
24 # The overall display should also reflect the new setting.
Johnny Chen77377772010-09-07 17:06:13 +000025 self.expect("settings show",
26 substrs = ["prompt (string) = 'lldb2'"])
27
28
29if __name__ == '__main__':
30 import atexit
31 lldb.SBDebugger.Initialize()
32 atexit.register(lambda: lldb.SBDebugger.Terminate())
33 unittest2.main()