Skip to content

Commit

Permalink
Add all kernel breakpoints hit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzEeKkAa authored and diptorupd committed May 15, 2024
1 parent 404adf1 commit a71c102
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions numba_dpex/tests/debugging/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ def info_functions(self, function):
def info_locals(self):
self._command("info locals")

def continue_(self):
self._command("continue")

def next(self):
self._command("next")

Expand Down
26 changes: 26 additions & 0 deletions numba_dpex/tests/debugging/test_breakpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,29 @@ def test_kernel_breakpoint(app: gdb, condition, exp_var, exp_val):
app.expect_hit_breakpoint("simple_sum.py:13")
if exp_var is not None:
app.print(exp_var, expected=exp_val)


def test_all_kernel_breakpoints_hit(app: gdb):
"""Test that every thread was hit"""

app.breakpoint("simple_sum.py:13")
app.run("simple_sum.py")

indexes = []

for _ in range(10):
app.expect_hit_breakpoint("simple_sum.py:13")

# Recover the index of the thread
app._command("print i")
app.child.expect(r"\$[0-9]+ = ")
index = app.child.read(1)
app.expect_eol()

indexes.append(int(index))

app.continue_()

indexes.sort()

assert indexes == list(range(10))

0 comments on commit a71c102

Please sign in to comment.