Add test test functions for cpp/python exceptions

This commit is contained in:
Oleksandr Pavlyk
2025-08-04 10:04:20 -05:00
parent 40a2337a6b
commit a5e0a48f80

View File

@@ -725,4 +725,10 @@ PYBIND11_MODULE(_nvbench, m)
},
"Run all registered benchmarks",
py::arg("argv") = py::list());
m.def("test_cpp_exception", []() { throw nvbench_run_error("Test"); });
m.def("test_py_exception", []() {
py::set_error(benchmark_exc, "Test");
throw py::error_already_set();
});
}