|
10 | 10 | import re
|
11 | 11 | import json
|
12 | 12 |
|
13 |
| -class TestVSCode_eventStatistic(lldbvscode_testcase.VSCodeTestCaseBase): |
14 |
| - |
15 |
| - def check_statistic(self, statistics): |
16 |
| - self.assertTrue(statistics['totalDebugInfoByteSize'] > 0) |
17 |
| - self.assertTrue(statistics['totalDebugInfoEnabled'] > 0) |
18 |
| - self.assertTrue(statistics['totalModuleCountHasDebugInfo'] > 0) |
19 |
| - |
20 |
| - self.assertIsNotNone(statistics['memory']) |
21 |
| - self.assertNotIn('modules', statistics.keys()) |
22 |
| - |
23 |
| - def check_target(self, statistics): |
24 |
| - # lldb-vscode debugs one target at a time |
25 |
| - target = json.loads(statistics['targets'])[0] |
26 |
| - self.assertTrue(target['totalBreakpointResolveTime'] > 0) |
27 |
| - |
28 |
| - breakpoints = target['breakpoints'] |
29 |
| - self.assertIn('foo', |
30 |
| - breakpoints[0]['details']['Breakpoint']['BKPTResolver']['Options']['SymbolNames'], |
31 |
| - 'foo is a symbol breakpoint') |
32 |
| - self.assertTrue(breakpoints[1]['details']['Breakpoint']['BKPTResolver']['Options']['FileName'].endswith('main.cpp'), |
33 |
| - 'target has source line breakpoint in main.cpp') |
| 13 | +class TestVSCode_terminatedEvent(lldbvscode_testcase.VSCodeTestCaseBase): |
34 | 14 |
|
35 | 15 | @skipIfWindows
|
36 | 16 | @skipIfRemote
|
@@ -65,34 +45,20 @@ def test_terminated_event(self):
|
65 | 45 | self.continue_to_exit()
|
66 | 46 |
|
67 | 47 | statistics = self.vscode.wait_for_terminated()['statistics']
|
68 |
| - self.check_statistic(statistics) |
69 |
| - self.check_target(statistics) |
| 48 | + self.assertTrue(statistics['totalDebugInfoByteSize'] > 0) |
| 49 | + self.assertTrue(statistics['totalDebugInfoEnabled'] > 0) |
| 50 | + self.assertTrue(statistics['totalModuleCountHasDebugInfo'] > 0) |
70 | 51 |
|
71 |
| - @skipIfWindows |
72 |
| - @skipIfRemote |
73 |
| - @expectedFailureAll(oslist=['linux'], archs=['arm', 'aarch64']) |
74 |
| - def test_initialized_event(self): |
75 |
| - ''' |
76 |
| - Initialized Event |
77 |
| - Now contains the statistics of a debug session: |
78 |
| - totalDebugInfoByteSize > 0 |
79 |
| - totalDebugInfoEnabled > 0 |
80 |
| - totalModuleCountHasDebugInfo > 0 |
81 |
| - totalBreakpointResolveTime > 0 |
82 |
| - ... |
83 |
| - ''' |
| 52 | + self.assertIsNotNone(statistics['memory']) |
| 53 | + self.assertNotIn('modules', statistics.keys()) |
84 | 54 |
|
85 |
| - program_basename = "a.out.stripped" |
86 |
| - program = self.getBuildArtifact(program_basename) |
87 |
| - self.build_and_launch(program) |
88 |
| - # Set breakpoints |
89 |
| - functions = ['foo'] |
90 |
| - breakpoint_ids = self.set_function_breakpoints(functions) |
91 |
| - self.assertEquals(len(breakpoint_ids), len(functions), 'expect one breakpoint') |
92 |
| - main_bp_line = line_number('main.cpp', '// main breakpoint 1') |
93 |
| - breakpoint_ids.append(self.set_source_breakpoints('main.cpp', [main_bp_line])) |
| 55 | + # lldb-vscode debugs one target at a time |
| 56 | + target = json.loads(statistics['targets'])[0] |
| 57 | + self.assertTrue(target['totalBreakpointResolveTime'] > 0) |
94 | 58 |
|
95 |
| - self.continue_to_breakpoints(breakpoint_ids) |
96 |
| - statistics = self.vscode.initialized_event['statistics'] |
97 |
| - self.check_statistic(statistics) |
98 |
| - self.continue_to_exit() |
| 59 | + breakpoints = target['breakpoints'] |
| 60 | + self.assertIn('foo', |
| 61 | + breakpoints[0]['details']['Breakpoint']['BKPTResolver']['Options']['SymbolNames'], |
| 62 | + 'foo is a symbol breakpoint') |
| 63 | + self.assertTrue(breakpoints[1]['details']['Breakpoint']['BKPTResolver']['Options']['FileName'].endswith('main.cpp'), |
| 64 | + 'target has source line breakpoint in main.cpp') |
0 commit comments