@@ -79,7 +79,8 @@ def test_basic(self):
7979 self .assertIsNotNone (leaf_frame , "expect a leaf frame" )
8080 self .assertEqual (step_in_targets [1 ]["label" ], leaf_frame ["name" ])
8181
82- def test_supported_capability (self ):
82+ @skipIf (archs = no_match (["x86" , "x86_64" ]))
83+ def test_supported_capability_x86_arch (self ):
8384 program = self .getBuildArtifact ("a.out" )
8485 self .build_and_launch (program )
8586 source = "main.cpp"
@@ -91,18 +92,35 @@ def test_supported_capability(self):
9192 is_supported = self .dap_server .get_initialize_value (
9293 "supportsStepInTargetsRequest"
9394 )
94- arch : str = self .getArchitecture ()
95- if arch .startswith ("x86" ):
96- self .assertTrue (
97- is_supported ,
98- f"expect capability `stepInTarget` is supported with architecture { arch } " ,
99- )
100- else :
101- self .assertFalse (
102- is_supported ,
103- f"expect capability `stepInTarget` is not supported with architecture { arch } " ,
104- )
10595
96+ self .assertEqual (
97+ is_supported ,
98+ True ,
99+ f"expect capability `stepInTarget` is supported with architecture { self .getArchitecture ()} " ,
100+ )
101+ # clear breakpoints.
102+ self .set_source_breakpoints (source , [])
103+ self .continue_to_exit ()
104+
105+ @skipIf (archs = ["x86" , "x86_64" ])
106+ def test_supported_capability_other_archs (self ):
107+ program = self .getBuildArtifact ("a.out" )
108+ self .build_and_launch (program )
109+ source = "main.cpp"
110+ bp_lines = [line_number (source , "// set breakpoint here" )]
111+ breakpoint_ids = self .set_source_breakpoints (source , bp_lines )
112+ self .assertEqual (
113+ len (breakpoint_ids ), len (bp_lines ), "expect correct number of breakpoints"
114+ )
115+ is_supported = self .dap_server .get_initialize_value (
116+ "supportsStepInTargetsRequest"
117+ )
118+
119+ self .assertEqual (
120+ is_supported ,
121+ False ,
122+ f"expect capability `stepInTarget` is not supported with architecture { self .getArchitecture ()} " ,
123+ )
106124 # clear breakpoints.
107125 self .set_source_breakpoints (source , [])
108126 self .continue_to_exit ()
0 commit comments