From 1f74a24ac05ce493a46bdadec4d7c089398214b5 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Wed, 10 Jan 2018 23:06:34 +0000 Subject: Runs the part of the test that just finds the binary on all systems. That should work everywhere. Then only try actually running on macosx. llvm-svn: 322235 --- .../find-app-in-bundle/TestFindAppInBundle.py | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'lldb/packages/Python/lldbsuite') diff --git a/lldb/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestFindAppInBundle.py b/lldb/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestFindAppInBundle.py index a64bd2ee184..c5dbe579587 100644 --- a/lldb/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestFindAppInBundle.py +++ b/lldb/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestFindAppInBundle.py @@ -11,9 +11,9 @@ import re import lldb from lldbsuite.test.decorators import * import lldbsuite.test.lldbutil as lldbutil +import lldbsuite.test.lldbplatformutil as lldbplatformutil from lldbsuite.test.lldbtest import * -@decorators.skipUnlessDarwin class FindAppInMacOSAppBundle(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -46,17 +46,18 @@ class FindAppInMacOSAppBundle(TestBase): bkpt = target.BreakpointCreateBySourceRegex("Set a breakpoint here", self.main_source_file) self.assertTrue(bkpt.GetNumLocations() == 1, "Couldn't set a breakpoint in the main app") - launch_info = lldb.SBLaunchInfo(None) - launch_info.SetWorkingDirectory(self.get_process_working_directory()) - - error = lldb.SBError() - process = target.Launch(launch_info, error) - - self.assertTrue(process, "Could not create a valid process for TestApp: %s"%(error.GetCString())) - - # Frame #0 should be at our breakpoint. - threads = lldbutil.get_threads_stopped_at_breakpoint(process, bkpt) - - self.assertTrue(len(threads) == 1, "Expected 1 thread to stop at breakpoint, %d did."%(len(threads))) + if lldbplatformutil.getPlatform() == "macosx": + launch_info = lldb.SBLaunchInfo(None) + launch_info.SetWorkingDirectory(self.get_process_working_directory()) + + error = lldb.SBError() + process = target.Launch(launch_info, error) + + self.assertTrue(process, "Could not create a valid process for TestApp: %s"%(error.GetCString())) + + # Frame #0 should be at our breakpoint. + threads = lldbutil.get_threads_stopped_at_breakpoint(process, bkpt) + + self.assertTrue(len(threads) == 1, "Expected 1 thread to stop at breakpoint, %d did."%(len(threads))) -- cgit v1.2.3