8
8
from lldbsuite .test .decorators import *
9
9
from lldbsuite .test .lldbtest import *
10
10
11
- file_index = 0
12
11
13
12
class JITLoaderGDBTestCase (TestBase ):
14
13
@@ -27,25 +26,18 @@ def test_bogus_values(self):
27
26
target = self .dbg .CreateTarget (exe )
28
27
self .assertTrue (target , VALID_TARGET )
29
28
30
- # launch the process, do not stop at entry point.
29
+ # Launch the process, do not stop at entry point.
31
30
process = target .LaunchSimple (
32
31
None , None , self .get_process_working_directory ())
33
32
self .assertTrue (process , PROCESS_IS_VALID )
34
33
35
34
# The inferior will now pass bogus values over the interface. Make sure
36
35
# we don't crash.
37
-
38
36
self .assertEqual (process .GetState (), lldb .eStateExited )
39
37
self .assertEqual (process .GetExitStatus (), 0 )
40
38
41
39
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 ()))
49
41
def cleanup ():
50
42
if os .path .exists (logfile ):
51
43
os .unlink (logfile )
@@ -70,7 +62,7 @@ def cleanup():
70
62
self .runCmd ("settings set plugin.jit-loader.gdb.enable default" )
71
63
self .addTearDownHook (cleanup )
72
64
73
- # launch the process
65
+ # Launch the process.
74
66
target = self .dbg .CreateTarget (exe )
75
67
self .assertTrue (target , VALID_TARGET )
76
68
process = target .LaunchSimple (
@@ -80,11 +72,10 @@ def cleanup():
80
72
self .assertEqual (process .GetState (), lldb .eStateExited )
81
73
self .assertEqual (process .GetExitStatus (), 0 )
82
74
83
- logcontent = ""
84
- if os .path .exists (logfile ):
75
+ if not configuration . is_reproducer ():
76
+ self . assertTrue ( os .path .exists (logfile ))
85
77
logcontent = open (logfile ).read ()
86
- self .assertIn (
87
- "SetJITBreakpoint setting JIT breakpoint" , logcontent )
78
+ self .assertIn ("SetJITBreakpoint setting JIT breakpoint" , logcontent )
88
79
89
80
@skipIfWindows # This test fails on Windows during C code build
90
81
def test_jit_int_off (self ):
@@ -100,7 +91,7 @@ def cleanup():
100
91
self .runCmd ("settings set plugin.jit-loader.gdb.enable default" )
101
92
self .addTearDownHook (cleanup )
102
93
103
- # launch the process
94
+ # Launch the process.
104
95
target = self .dbg .CreateTarget (exe )
105
96
self .assertTrue (target , VALID_TARGET )
106
97
process = target .LaunchSimple (
@@ -110,9 +101,7 @@ def cleanup():
110
101
self .assertEqual (process .GetState (), lldb .eStateExited )
111
102
self .assertEqual (process .GetExitStatus (), 0 )
112
103
113
- if os .path .exists (logfile ):
104
+ if not configuration .is_reproducer ():
105
+ self .assertTrue (os .path .exists (logfile ))
114
106
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