Skip to content

Commit adf16b9

Browse files
author
git apple-llvm automerger
committed
Merge commit 'c151230533e0' from llvm.org/master into apple/master
2 parents 4513f29 + c151230 commit adf16b9

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

lldb/test/API/functionalities/jitloader_gdb/TestJITLoaderGDB.py

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from lldbsuite.test.decorators import *
99
from lldbsuite.test.lldbtest import *
1010

11-
file_index = 0
1211

1312
class JITLoaderGDBTestCase(TestBase):
1413

@@ -27,25 +26,18 @@ def test_bogus_values(self):
2726
target = self.dbg.CreateTarget(exe)
2827
self.assertTrue(target, VALID_TARGET)
2928

30-
# launch the process, do not stop at entry point.
29+
# Launch the process, do not stop at entry point.
3130
process = target.LaunchSimple(
3231
None, None, self.get_process_working_directory())
3332
self.assertTrue(process, PROCESS_IS_VALID)
3433

3534
# The inferior will now pass bogus values over the interface. Make sure
3635
# we don't crash.
37-
3836
self.assertEqual(process.GetState(), lldb.eStateExited)
3937
self.assertEqual(process.GetExitStatus(), 0)
4038

4139
def gen_log_file(self):
42-
global file_index
43-
++file_index
44-
logfile = os.path.join(
45-
self.getBuildDir(),
46-
"jitintgdb-" + self.getArchitecture() + "-" +
47-
str(file_index) + ".txt")
48-
40+
logfile = self.getBuildArtifact("jitintgdb-{}.txt".format(self.getArchitecture()))
4941
def cleanup():
5042
if os.path.exists(logfile):
5143
os.unlink(logfile)
@@ -70,7 +62,7 @@ def cleanup():
7062
self.runCmd("settings set plugin.jit-loader.gdb.enable default")
7163
self.addTearDownHook(cleanup)
7264

73-
# launch the process
65+
# Launch the process.
7466
target = self.dbg.CreateTarget(exe)
7567
self.assertTrue(target, VALID_TARGET)
7668
process = target.LaunchSimple(
@@ -80,11 +72,10 @@ def cleanup():
8072
self.assertEqual(process.GetState(), lldb.eStateExited)
8173
self.assertEqual(process.GetExitStatus(), 0)
8274

83-
logcontent = ""
84-
if os.path.exists(logfile):
75+
if not configuration.is_reproducer():
76+
self.assertTrue(os.path.exists(logfile))
8577
logcontent = open(logfile).read()
86-
self.assertIn(
87-
"SetJITBreakpoint setting JIT breakpoint", logcontent)
78+
self.assertIn("SetJITBreakpoint setting JIT breakpoint", logcontent)
8879

8980
@skipIfWindows # This test fails on Windows during C code build
9081
def test_jit_int_off(self):
@@ -100,7 +91,7 @@ def cleanup():
10091
self.runCmd("settings set plugin.jit-loader.gdb.enable default")
10192
self.addTearDownHook(cleanup)
10293

103-
# launch the process
94+
# Launch the process.
10495
target = self.dbg.CreateTarget(exe)
10596
self.assertTrue(target, VALID_TARGET)
10697
process = target.LaunchSimple(
@@ -110,9 +101,7 @@ def cleanup():
110101
self.assertEqual(process.GetState(), lldb.eStateExited)
111102
self.assertEqual(process.GetExitStatus(), 0)
112103

113-
if os.path.exists(logfile):
104+
if not configuration.is_reproducer():
105+
self.assertTrue(os.path.exists(logfile))
114106
logcontent = open(logfile).read()
115-
self.assertNotIn(
116-
"SetJITBreakpoint setting JIT breakpoint", logcontent)
117-
else:
118-
self.assertTrue(false)
107+
self.assertNotIn("SetJITBreakpoint setting JIT breakpoint", logcontent)

0 commit comments

Comments
 (0)