@@ -16,7 +16,10 @@ def test_stats_api(self):
16
16
"""
17
17
self .build ()
18
18
exe = self .getBuildArtifact ("a.out" )
19
- target = self .dbg .CreateTarget (exe )
19
+ # Launch a process and break
20
+ (target , process , thread , bkpt ) = lldbutil .run_to_source_breakpoint (
21
+ self , "break here" , lldb .SBFileSpec ("main.c" )
22
+ )
20
23
21
24
# Test enabling/disabling stats
22
25
self .assertFalse (target .GetCollectingStats ())
@@ -79,16 +82,17 @@ def test_stats_api(self):
79
82
stats_options .SetSummaryOnly (True )
80
83
stats_summary = target .GetStatistics (stats_options )
81
84
stream_summary = lldb .SBStream ()
82
- res = stats_summary .GetAsJSON (stream_summary )
85
+ stats_summary .GetAsJSON (stream_summary )
83
86
debug_stats_summary = json .loads (stream_summary .GetData ())
84
87
self .assertNotIn ("modules" , debug_stats_summary )
85
88
self .assertNotIn ("memory" , debug_stats_summary )
86
89
self .assertNotIn ("commands" , debug_stats_summary )
87
90
88
91
# Summary values should be the same as in full statistics.
92
+ # Except the parse time on Mac OS X is not deterministic.
89
93
for key , value in debug_stats_summary .items ():
90
94
self .assertIn (key , debug_stats )
91
- if key != "targets" :
95
+ if key != "targets" and not key . endswith ( "Time" ) :
92
96
self .assertEqual (debug_stats [key ], value )
93
97
94
98
def test_command_stats_api (self ):
0 commit comments