From e28824f4399ce340f4683725cebe25e288890e15 Mon Sep 17 00:00:00 2001 From: Nick Le Large Date: Thu, 19 Dec 2024 09:34:19 +0000 Subject: [PATCH] Pass unittest flag to python executable to make sure error code is set to 1 if tests fail Otherwise ctest will not report broken tests --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8bdd3f5..4694f20 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -141,7 +141,7 @@ if(pybind11_FOUND) configure_file(${_py_test} ${PY_TEST_NAME} COPYONLY) add_test(NAME ${PY_TEST_NAME} - COMMAND ${Python3_EXECUTABLE} ${PY_TEST_NAME} + COMMAND ${Python3_EXECUTABLE} -m unittest ${PY_TEST_NAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) endforeach()