Changeset View
Changeset View
Standalone View
Standalone View
lldb/trunk/test/functionalities/platform/TestPlatformCommand.py
Show All 27 Lines | def test_process_info_with_no_arg(self): | ||||
substrs = ['one or more process id(s) must be specified']) | substrs = ['one or more process id(s) must be specified']) | ||||
def test_status(self): | def test_status(self): | ||||
self.expect("platform status", | self.expect("platform status", | ||||
substrs = ['Platform', 'Triple', 'OS Version', 'Kernel', 'Hostname']) | substrs = ['Platform', 'Triple', 'OS Version', 'Kernel', 'Hostname']) | ||||
def test_shell(self): | def test_shell(self): | ||||
""" Test that the platform shell command can invoke ls. """ | """ Test that the platform shell command can invoke ls. """ | ||||
if sys.platform.startswith("win32"): | triple = self.dbg.GetSelectedPlatform().GetTriple() | ||||
if re.match(".*-.*-windows", triple): | |||||
self.expect("platform shell dir c:\\", substrs = ["Windows", "Program Files"]) | self.expect("platform shell dir c:\\", substrs = ["Windows", "Program Files"]) | ||||
elif re.match(".*-.*-.*-android", triple): | |||||
self.expect("platform shell ls /", substrs = ["cache", "dev", "system"]) | |||||
else: | else: | ||||
self.expect("platform shell ls /", substrs = ["dev", "tmp", "usr"]) | self.expect("platform shell ls /", substrs = ["dev", "tmp", "usr"]) | ||||
def test_shell_builtin(self): | def test_shell_builtin(self): | ||||
""" Test a shell built-in command (echo) """ | """ Test a shell built-in command (echo) """ | ||||
self.expect("platform shell echo hello lldb", | self.expect("platform shell echo hello lldb", | ||||
substrs = ["hello lldb"]) | substrs = ["hello lldb"]) | ||||
Show All 13 Lines |