Skip to content

Commit f701fb0

Browse files
ZzEeKkAaDiptorup Deb
authored and
Diptorup Deb
committed
Add all kernel breakpoints hit test
1 parent 574daab commit f701fb0

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

numba_dpex/tests/debugging/gdb.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ def info_functions(self, function):
139139
def info_locals(self):
140140
self._command("info locals")
141141

142+
def continue_(self):
143+
self._command("continue")
144+
142145
def next(self):
143146
self._command("next")
144147

numba_dpex/tests/debugging/test_breakpoints.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,29 @@ def test_kernel_breakpoint(app: gdb, condition, exp_var, exp_val):
8888
app.expect_hit_breakpoint("simple_sum.py:13")
8989
if exp_var is not None:
9090
app.print(exp_var, expected=exp_val)
91+
92+
93+
def test_all_kernel_breakpoints_hit(app: gdb):
94+
"""Test that every thread was hit"""
95+
96+
app.breakpoint("simple_sum.py:13")
97+
app.run("simple_sum.py")
98+
99+
indexes = []
100+
101+
for _ in range(10):
102+
app.expect_hit_breakpoint("simple_sum.py:13")
103+
104+
# Recover the index of the thread
105+
app._command("print i")
106+
app.child.expect(r"\$[0-9]+ = ")
107+
index = app.child.read(1)
108+
app.expect_eol()
109+
110+
indexes.append(int(index))
111+
112+
app.continue_()
113+
114+
indexes.sort()
115+
116+
assert indexes == list(range(10))

0 commit comments

Comments
 (0)