aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/plugin/diagnostic-test-paths-2.py
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/plugin/diagnostic-test-paths-2.py')
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic-test-paths-2.py35
1 files changed, 24 insertions, 11 deletions
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-paths-2.py b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-paths-2.py
index c212e49..f0fed45 100644
--- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-paths-2.py
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-paths-2.py
@@ -8,12 +8,6 @@ import pytest
def html_tree():
return html_tree_from_env()
-XHTML = 'http://www.w3.org/1999/xhtml'
-ns = {'xhtml': XHTML}
-
-def make_tag(local_name):
- return f'{{{XHTML}}}' + local_name
-
def test_paths(html_tree):
root = html_tree.getroot ()
assert root.tag == make_tag('html')
@@ -27,9 +21,28 @@ def test_paths(html_tree):
diag = diag_list.find('xhtml:div', ns)
assert diag is not None
- assert diag.attrib['class'] == 'gcc-diagnostic'
+ assert diag.attrib['class'] == 'alert alert-danger'
+ assert diag.attrib['id'] == 'gcc-diag-0'
+
+ exec_path = diag.find("./xhtml:div[@id='execution-path']", ns)
+ assert exec_path is not None
+
+ label = exec_path.find('xhtml:label', ns)
+ assert label.text == 'Execution path with 3 events'
+
+ event_ranges = exec_path.find('xhtml:div', ns)
+ assert_class(event_ranges, 'event-ranges')
+
+ frame_margin = event_ranges.find('xhtml:table', ns)
+ assert_class(frame_margin, 'stack-frame-with-margin')
+
+ tr = frame_margin.find('xhtml:tr', ns)
+ assert tr is not None
+ tds = tr.findall('xhtml:td', ns)
+ assert len(tds) == 2
+
+ assert_class(tds[0], 'interprocmargin')
- pre = diag.findall('xhtml:pre', ns)
- assert pre[0].attrib['class'] == 'gcc-annotated-source'
- assert pre[1].attrib['class'] == 'gcc-execution-path'
- assert pre[1].text.startswith(" 'make_a_list_of_random_ints_badly': events 1-3")
+ test_frame = tds[1]
+ assert_frame(test_frame, 'make_a_list_of_random_ints_badly')
+ assert_event_range_with_margin(test_frame[1])