Skip to content

Commit 4eeb0e8

Browse files
cmastallijorisv
authored andcommitted
[cmake] Created command to run python unit tests individually
1 parent 5c02a39 commit 4eeb0e8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

unittest/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ function(add_python_eigenpy_lib_unit_test name source)
7373
set(test_target ${PROJECT_NAME}-${name})
7474
add_python_unit_test(${test_target} ${source} "lib" "bin" "python")
7575
set_tests_properties(${test_target} PROPERTIES DEPENDS ${PYWRAP})
76+
string(REPLACE "unittest/" "" source_rel "${source}")
77+
add_custom_target(
78+
"test-${name}"
79+
${CMAKE_COMMAND}
80+
-E
81+
env
82+
PYTHONPATH=${PROJECT_BINARY_DIR}/lib:${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH}
83+
${PYTHON_EXECUTABLE}
84+
"${CMAKE_CURRENT_SOURCE_DIR}/${source_rel}")
7685
endfunction()
7786

7887
function(add_python_eigenpy_unit_test name source)

0 commit comments

Comments
 (0)