Johnny Chen | c640179 | 2011-03-30 21:19:59 +0000 | [diff] [blame^] | 1 | """ |
| 2 | Test some lldb platform commands. |
| 3 | """ |
| 4 | |
| 5 | import os, time |
| 6 | import unittest2 |
| 7 | import lldb |
| 8 | from lldbtest import * |
| 9 | |
| 10 | class PlatformCommandTestCase(TestBase): |
| 11 | |
| 12 | mydir = "platform" |
| 13 | |
| 14 | def test_help_platform(self): |
| 15 | self.runCmd("help platform") |
| 16 | |
| 17 | def test_list(self): |
| 18 | self.expect("platform list", |
| 19 | patterns = ['^Available platforms:']) |
| 20 | |
| 21 | def test_process_list(self): |
| 22 | self.expect("platform process list", |
| 23 | substrs = ['PID', 'TRIPLE', 'NAME']) |
| 24 | |
| 25 | def test_status(self): |
| 26 | self.expect("platform status", |
| 27 | substrs = ['Platform', 'Triple', 'OS Version', 'Kernel', 'Hostname']) |
| 28 | |
| 29 | |
| 30 | if __name__ == '__main__': |
| 31 | import atexit |
| 32 | lldb.SBDebugger.Initialize() |
| 33 | atexit.register(lambda: lldb.SBDebugger.Terminate()) |
| 34 | unittest2.main() |