Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all kernel breakpoints hit test #1453

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
Loading