Skip to content

Commit

Permalink
only clean the test results of the current project (fix #737)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed May 22, 2015
1 parent 537e81d commit 52dbdd5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/test/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ if(NOT TARGET run_tests)
add_custom_target(run_tests)
endif()

# create target to clean test results
# create target to clean all test results
if(NOT TARGET clean_test_results)
add_custom_target(clean_test_results
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CATKIN_TEST_RESULTS_DIR})
endif()
# create target to clean project specific test results
if(NOT TARGET clean_test_results_${PROJECT_NAME})
add_custom_target(clean_test_results_${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME})
endif()

#
# Create a test target, integrate it with the run_tests infrastructure
Expand Down Expand Up @@ -140,5 +145,5 @@ function(catkin_run_tests_target type name xunit_filename)
add_custom_target(_run_tests_${PROJECT_NAME}_${type}_${name}
COMMAND ${cmd})
add_dependencies(_run_tests_${PROJECT_NAME}_${type} _run_tests_${PROJECT_NAME}_${type}_${name})
add_dependencies(_run_tests_${PROJECT_NAME}_${type}_${name} clean_test_results tests ${_testing_DEPENDENCIES})
add_dependencies(_run_tests_${PROJECT_NAME}_${type}_${name} clean_test_results_${PROJECT_NAME} tests ${_testing_DEPENDENCIES})
endfunction()

0 comments on commit 52dbdd5

Please sign in to comment.