From 219d510d9c07405e497a852f891c82c667339a2f Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Wed, 18 Dec 2013 23:17:15 +0100 Subject: [PATCH 1/2] Add a new CMake target "tests" This commit adds a new custom target called "tests". In contrast with the standard "test" target it has all the test binaries listed as its dependencies. Consequently, a single command `make tests` is sufficient to build all tests (and nothing else) and run them. --- cmake/pcl_targets.cmake | 2 ++ test/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmake/pcl_targets.cmake b/cmake/pcl_targets.cmake index 9e38cab8e5c..c942f08fe95 100644 --- a/cmake/pcl_targets.cmake +++ b/cmake/pcl_targets.cmake @@ -449,6 +449,8 @@ macro(PCL_ADD_TEST _name _exename) else(${CMAKE_VERSION} VERSION_LESS 2.8.4) add_test(NAME ${_name} COMMAND ${_exename} ${PCL_ADD_TEST_ARGUMENTS}) endif(${CMAKE_VERSION} VERSION_LESS 2.8.4) + + add_dependencies(tests ${_exename}) endmacro(PCL_ADD_TEST) ############################################################################### diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6aa645902bc..146b7f7ef1b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,6 +27,8 @@ if(build) enable_testing() include_directories(${PCL_INCLUDE_DIRS}) + add_custom_target(tests ${CMAKE_CTEST_COMMAND}) + add_subdirectory(2d) add_subdirectory(common) add_subdirectory(features) From 362188f0cb1e472ee51ca386fede46e703c6d354 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Thu, 19 Dec 2013 13:04:14 +0100 Subject: [PATCH 2/2] Enable verbose output for "tests" target This commit adds "-V" switch to the invocation of `ctest` in the "tests" target. Doing so allows us to see the output of individual tests in addition to the summary provided by `ctest`. --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 146b7f7ef1b..0be856728d0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,7 +27,7 @@ if(build) enable_testing() include_directories(${PCL_INCLUDE_DIRS}) - add_custom_target(tests ${CMAKE_CTEST_COMMAND}) + add_custom_target(tests ${CMAKE_CTEST_COMMAND} -V) add_subdirectory(2d) add_subdirectory(common)