From 0f640999c2758bd00413927e463d070215fa58a0 Mon Sep 17 00:00:00 2001 From: Diptorup Deb Date: Fri, 26 Apr 2024 16:16:12 -0500 Subject: [PATCH] Update test cases based on latest changes to DWARF generation. --- numba_dpex/tests/debugging/test_backtraces.py | 6 ++---- numba_dpex/tests/debugging/test_breakpoints.py | 5 ----- numba_dpex/tests/debugging/test_info.py | 2 +- numba_dpex/tests/debugging/test_stepping.py | 4 ++-- numba_dpex/tests/test_debuginfo.py | 10 +++++----- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/numba_dpex/tests/debugging/test_backtraces.py b/numba_dpex/tests/debugging/test_backtraces.py index 117eccddc0..7a4e736d9a 100644 --- a/numba_dpex/tests/debugging/test_backtraces.py +++ b/numba_dpex/tests/debugging/test_backtraces.py @@ -25,7 +25,5 @@ def test_backtrace(app): app.backtrace() - app.expect( - r"#0.*__main__::func_sum.* at simple_dpex_func.py:12", with_eol=True - ) - app.expect(r"#1.*__main__::kernel_sum", with_eol=True) + app.expect(r"#0.*func_sum.* at simple_dpex_func.py:12", with_eol=True) + app.expect(r"#1.*kernel_sum", with_eol=True) diff --git a/numba_dpex/tests/debugging/test_breakpoints.py b/numba_dpex/tests/debugging/test_breakpoints.py index ef178e5415..701d4b823b 100644 --- a/numba_dpex/tests/debugging/test_breakpoints.py +++ b/numba_dpex/tests/debugging/test_breakpoints.py @@ -56,11 +56,6 @@ def test_device_func_breakpoint( SAT-4449 """ - if api == "numba-ndpx-kernel" and breakpoint != "side-by-side.py:15": - pytest.skip( - "Breakpoint by function name not working for numba-dpex." - ) # TODO: https://github.com/IntelPython/numba-dpex/issues/1242 - app.breakpoint(breakpoint, condition=condition) app.run(f"side-by-side.py --api={api}") app.expect_hit_breakpoint("side-by-side.py:15") diff --git a/numba_dpex/tests/debugging/test_info.py b/numba_dpex/tests/debugging/test_info.py index 421aba8e16..c9f75dd102 100644 --- a/numba_dpex/tests/debugging/test_info.py +++ b/numba_dpex/tests/debugging/test_info.py @@ -104,7 +104,7 @@ def test_info_functions(app): app.info_functions("data_parallel_sum") - app.child.expect(r"11:\s+[a-z 0-9\*]+__main__::data_parallel_sum") + app.child.expect(r"11:\s+[a-z 0-9\*]+data_parallel_sum") @pytest.mark.parametrize( diff --git a/numba_dpex/tests/debugging/test_stepping.py b/numba_dpex/tests/debugging/test_stepping.py index 58464350b4..71fedcab83 100644 --- a/numba_dpex/tests/debugging/test_stepping.py +++ b/numba_dpex/tests/debugging/test_stepping.py @@ -31,7 +31,7 @@ def test_next(app: gdb): ) # checking that we did not step in app.next() - app.expect(r"in _ZN8__main__21kernel_sum_", with_eol=True) + app.expect(r"in _ZN8__main__14kernel_sum_", with_eol=True) def test_step(app: gdb): @@ -44,7 +44,7 @@ def test_step(app: gdb): ) app.set_scheduler_lock() app.step() - app.expect(r"__main__::func_sum.* at simple_dpex_func.py:12", with_eol=True) + app.expect(r"func_sum.* at simple_dpex_func.py:12", with_eol=True) app.expect(r"12\s+result = a_in_func \+ b_in_func", with_eol=True) app.step() app.expect( diff --git a/numba_dpex/tests/test_debuginfo.py b/numba_dpex/tests/test_debuginfo.py index e95e9e6d1f..87909f9cf1 100644 --- a/numba_dpex/tests/test_debuginfo.py +++ b/numba_dpex/tests/test_debuginfo.py @@ -126,8 +126,8 @@ def data_parallel_sum(item, a, b, c): c[i] = func_sum(a[i], b[i]) ir_tags = [ - r'\!DISubprogram\(name: ".*func_sum\$?\d*"', - r'\!DISubprogram\(name: ".*data_parallel_sum\$?\d*"', + r'\!DISubprogram\(name: ".*func_sum*"', + r'\!DISubprogram\(name: ".*data_parallel_sum*"', ] sig = (itemty, f32arrty, f32arrty, f32arrty) @@ -156,8 +156,8 @@ def data_parallel_sum(item, a, b, c): c[i] = func_sum(a[i], b[i]) ir_tags = [ - r'\!DISubprogram\(name: ".*func_sum\$?\d*"', - r'\!DISubprogram\(name: ".*data_parallel_sum\$\d*"', + r'\!DISubprogram\(name: ".*func_sum*"', + r'\!DISubprogram\(name: ".*data_parallel_sum"', ] sig = (itemty, f32arrty, f32arrty, f32arrty) @@ -190,7 +190,7 @@ def foo(item, a, b): kernel_ir = kcres.library.get_llvm_str() for tag in ir_tags: - assert make_check(kernel_ir, tag) + assert not make_check(kernel_ir, tag) def test_debuginfo_DICompileUnit_language_and_producer():