Skip to content

Commit 866e047

Browse files
authored
Updated TestExec and TestObjCiVarIMP to use lldbutil.execute_command (apple#131)
1 parent f3f3a8e commit 866e047

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

packages/Python/lldbsuite/test/functionalities/exec/TestExec.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@
1212
from lldbsuite.test.lldbtest import *
1313
from lldbsuite.test import lldbutil
1414

15-
16-
def execute_command(command):
17-
#print('%% %s' % (command))
18-
(exit_status, output) = seven.get_command_status_output(command)
19-
# if output:
20-
# print(output)
21-
#print('status = %u' % (exit_status))
22-
return exit_status
23-
24-
2515
class ExecTestCase(TestBase):
2616

2717
mydir = TestBase.compute_mydir(__file__)
@@ -33,15 +23,15 @@ def test(self):
3323
if self.getArchitecture() == 'x86_64':
3424
source = os.path.join(os.getcwd(), "main.cpp")
3525
o_file = os.path.join(os.getcwd(), "main.o")
36-
execute_command(
26+
lldbutil.execute_command(
3727
"'%s' -g -O0 -arch i386 -arch x86_64 '%s' -c -o '%s'" %
3828
(os.environ["CC"], source, o_file))
39-
execute_command(
29+
lldbutil.execute_command(
4030
"'%s' -g -O0 -arch i386 -arch x86_64 '%s'" %
4131
(os.environ["CC"], o_file))
4232
if self.debug_info != "dsym":
4333
dsym_path = os.path.join(os.getcwd(), "a.out.dSYM")
44-
execute_command("rm -rf '%s'" % (dsym_path))
34+
lldbutil.execute_command("rm -rf '%s'" % (dsym_path))
4535
else:
4636
self.build()
4737

packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@
1515
from lldbsuite.test.lldbtest import *
1616
from lldbsuite.test import lldbutil
1717

18-
19-
def execute_command(command):
20-
# print('%% %s' % (command))
21-
(exit_status, output) = seven.get_command_status_output(command)
22-
# if output:
23-
# print(output)
24-
# print('status = %u' % (exit_status))
25-
return exit_status
26-
27-
2818
class ObjCiVarIMPTestCase(TestBase):
2919

3020
mydir = TestBase.compute_mydir(__file__)
@@ -34,10 +24,10 @@ class ObjCiVarIMPTestCase(TestBase):
3424
@expectedFailureDarwin("rdar://23590082")
3525
def test_imp_ivar_type(self):
3626
"""Test that dynamically discovered ivars of type IMP do not crash LLDB"""
37-
execute_command("make repro")
27+
lldbutil.execute_command("make repro")
3828

3929
def cleanup():
40-
execute_command("make cleanup")
30+
lldbutil.execute_command("make cleanup")
4131
self.addTearDownHook(cleanup)
4232

4333
exe = os.path.join(os.getcwd(), "a.out")

0 commit comments

Comments
 (0)