diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/platform')
| -rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py | 80 | ||||
| -rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py | 82 |
2 files changed, 0 insertions, 162 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py b/lldb/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py deleted file mode 100644 index 2e1deefe90e..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py +++ /dev/null @@ -1,80 +0,0 @@ -""" -Test some lldb platform commands. -""" - -from __future__ import print_function - - -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class PlatformCommandTestCase(TestBase): - - mydir = TestBase.compute_mydir(__file__) - - @no_debug_info_test - def test_help_platform(self): - self.runCmd("help platform") - - @no_debug_info_test - def test_list(self): - self.expect("platform list", - patterns=['^Available platforms:']) - - @no_debug_info_test - def test_process_list(self): - self.expect("platform process list", - substrs=['PID', 'TRIPLE', 'NAME']) - - @no_debug_info_test - def test_process_info_with_no_arg(self): - """This is expected to fail and to return a proper error message.""" - self.expect("platform process info", error=True, - substrs=['one or more process id(s) must be specified']) - - @no_debug_info_test - def test_status(self): - self.expect( - "platform status", - substrs=[ - 'Platform', - 'Triple', - 'OS Version', - 'Kernel', - 'Hostname']) - - @expectedFailureAll(oslist=["windows"]) - @no_debug_info_test - def test_shell(self): - """ Test that the platform shell command can invoke ls. """ - triple = self.dbg.GetSelectedPlatform().GetTriple() - if re.match(".*-.*-windows", triple): - 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: - self.expect("platform shell ls /", substrs=["dev", "tmp", "usr"]) - - @no_debug_info_test - def test_shell_builtin(self): - """ Test a shell built-in command (echo) """ - self.expect("platform shell echo hello lldb", - substrs=["hello lldb"]) - - # FIXME: re-enable once platform shell -t can specify the desired timeout - @no_debug_info_test - def test_shell_timeout(self): - """ Test a shell built-in command (sleep) that times out """ - self.skipTest("due to taking too long to complete.") - self.expect("platform shell sleep 15", error=True, substrs=[ - "error: timed out waiting for shell command to complete"]) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py b/lldb/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py deleted file mode 100644 index f105847d0bb..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py +++ /dev/null @@ -1,82 +0,0 @@ -""" -Test the lldb platform Python API. -""" - -from __future__ import print_function - - -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class PlatformPythonTestCase(TestBase): - - mydir = TestBase.compute_mydir(__file__) - - @add_test_categories(['pyapi']) - @no_debug_info_test - def test_platform_list(self): - """Test SBDebugger::GetNumPlatforms() & GetPlatformAtIndex() API""" - # Verify the host platform is present by default. - initial_num_platforms = self.dbg.GetNumPlatforms() - self.assertGreater(initial_num_platforms, 0) - host_platform = self.dbg.GetPlatformAtIndex(0) - self.assertTrue(host_platform.IsValid() and - host_platform.GetName() == 'host', - 'The host platform is present') - # Select another platform and verify that the platform is added to - # the platform list. - platform_idx = self.dbg.GetNumAvailablePlatforms() - 1 - if platform_idx < 1: - self.fail('No platforms other than host are available') - platform_data = self.dbg.GetAvailablePlatformInfoAtIndex(platform_idx) - platform_name = platform_data.GetValueForKey('name').GetStringValue(100) - self.assertNotEqual(platform_name, 'host') - self.dbg.SetCurrentPlatform(platform_name) - selected_platform = self.dbg.GetSelectedPlatform() - self.assertTrue(selected_platform.IsValid()) - self.assertEqual(selected_platform.GetName(), platform_name) - self.assertEqual(self.dbg.GetNumPlatforms(), initial_num_platforms + 1) - platform_found = False - for platform_idx in range(self.dbg.GetNumPlatforms()): - platform = self.dbg.GetPlatformAtIndex(platform_idx) - if platform.GetName() == platform_name: - platform_found = True - break - self.assertTrue(platform_found) - - @add_test_categories(['pyapi']) - @no_debug_info_test - def test_host_is_connected(self): - # We've already tested that this one IS the host platform. - host_platform = self.dbg.GetPlatformAtIndex(0) - self.assertTrue(host_platform.IsConnected(), "The host platform is always connected") - - - @add_test_categories(['pyapi']) - @no_debug_info_test - def test_available_platform_list(self): - """Test SBDebugger::GetNumAvailablePlatforms() and GetAvailablePlatformInfoAtIndex() API""" - num_platforms = self.dbg.GetNumAvailablePlatforms() - self.assertGreater( - num_platforms, 0, - 'There should be at least one platform available') - - for i in range(num_platforms): - platform_data = self.dbg.GetAvailablePlatformInfoAtIndex(i) - name_data = platform_data.GetValueForKey('name') - desc_data = platform_data.GetValueForKey('description') - self.assertTrue( - name_data and name_data.IsValid(), - 'Platform has a name') - self.assertEqual( - name_data.GetType(), lldb.eStructuredDataTypeString, - 'Platform name is a string') - self.assertTrue( - desc_data and desc_data.IsValid(), - 'Platform has a description') - self.assertEqual( - desc_data.GetType(), lldb.eStructuredDataTypeString, - 'Platform description is a string') |

