Skip to content

Commit b8004fe

Browse files
committed
cmake: Use generated tests
1 parent 7c39cd8 commit b8004fe

File tree

3 files changed

+5
-136
lines changed

3 files changed

+5
-136
lines changed

unittest/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ function(config_test test tagname opttype)
5555
configure_file(python/test_${test}.py.in
5656
${CMAKE_CURRENT_BINARY_DIR}/python/${py_file})
5757
add_lib_unit_test(${MODNAME})
58-
add_python_unit_test("py-${test}-${tagname}" "unittest/python/${py_file}"
59-
"unittest")
58+
set(PYTHON_TEST_NAME "py-${test}-${tagname}")
59+
add_test(NAME ${PYTHON_TEST_NAME}
60+
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/python/${py_file}")
61+
compute_pythonpath(ENV_VARIABLES "unittest")
62+
set_tests_properties(${PYTHON_TEST_NAME} PROPERTIES ENVIRONMENT "${ENV_VARIABLES}")
6063
endfunction()
6164

6265
config_test(variant boost "boost::variant")

unittest/python/test_optional_boost.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

unittest/python/test_optional_std.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)