From: Tim Kientzle Date: Thu, 20 Aug 2009 02:46:31 +0000 (-0400) Subject: New cmake test target: make run_all_tests X-Git-Tag: v2.8.0~419 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4427c8a5a18d40dea55d12116e6d55fc2ddb1c46;p=thirdparty%2Flibarchive.git New cmake test target: make run_all_tests This is still experimental and subject to change. SVN-Revision: 1379 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cce6ea4f..af16dd533 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -698,20 +698,10 @@ IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") ADD_DEFINITIONS(-Wall -Werror) ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") -DEFINE_PROPERTY(GLOBAL - PROPERTY ALL_TESTS - BRIEF_DOCS "Test targets to be run by run_all_tests" - FULL_DOCS "Test targets to be run by run_all_tests") +IF(ENABLE_TEST) +ADD_CUSTOM_TARGET(run_all_tests) +ENDIF(ENABLE_TEST) add_subdirectory(libarchive) add_subdirectory(tar) add_subdirectory(cpio) - -# This doesn't quite work and I don't understand why: the dependent -# tests do get run, but the final invocation of run_all_tests chokes. -# (At least on FreeBSD; I'll have to test on VS and MinGW and see what -# happens there.) -IF(ENABLE_TEST) -GET_PROPERTY(TESTS GLOBAL PROPERTY ALL_TESTS) -ADD_CUSTOM_TARGET(run_all_tests DEPENDS ${TESTS}) -ENDIF(ENABLE_TEST) diff --git a/cpio/test/CMakeLists.txt b/cpio/test/CMakeLists.txt index 4a0bb4b79..b383e85a6 100644 --- a/cpio/test/CMakeLists.txt +++ b/cpio/test/CMakeLists.txt @@ -66,13 +66,9 @@ IF(ENABLE_CPIO AND ENABLE_TEST) ENDIF(test MATCHES "^test_[^/]+[.]c$") ENDFOREACH(test) - # # Experimental new test handling - # ADD_CUSTOM_TARGET(run_bsdcpio_test - DEPENDS bsdcpio_test bsdcpio COMMAND bsdcpio_test -v -p ${BSDCPIO} -r ${CMAKE_CURRENT_SOURCE_DIR}) - - SET_PROPERTY(GLOBAL APPEND PROPERTY ALL_TESTS run_bsdcpio_test) + ADD_DEPENDENCIES(run_all_tests run_bsdcpio_test) ENDIF(ENABLE_CPIO AND ENABLE_TEST) diff --git a/libarchive/test/CMakeLists.txt b/libarchive/test/CMakeLists.txt index 320f3a90c..14d13e8ec 100644 --- a/libarchive/test/CMakeLists.txt +++ b/libarchive/test/CMakeLists.txt @@ -132,13 +132,9 @@ IF(ENABLE_TEST) ENDFOREACH(test) - # # Experimental new test handling - # ADD_CUSTOM_TARGET(run_libarchive_test - DEPENDS libarchive_test COMMAND libarchive_test -v -r ${CMAKE_CURRENT_SOURCE_DIR}) - - SET_PROPERTY(GLOBAL APPEND PROPERTY ALL_TESTS run_libarchive_test) + ADD_DEPENDENCIES(run_all_tests run_libarchive_test) ENDIF(ENABLE_TEST) diff --git a/tar/test/CMakeLists.txt b/tar/test/CMakeLists.txt index 24a835b33..06f311901 100644 --- a/tar/test/CMakeLists.txt +++ b/tar/test/CMakeLists.txt @@ -53,12 +53,9 @@ IF(ENABLE_TAR AND ENABLE_TEST) ENDIF(test MATCHES "^test_[^/]+[.]c$") ENDFOREACH(test) - # # Experimental new test handling - # ADD_CUSTOM_TARGET(run_bsdtar_test - DEPENDS bsdtar_test bsdtar COMMAND bsdtar_test -v -p ${BSDTAR} -r ${CMAKE_CURRENT_SOURCE_DIR}) + ADD_DEPENDENCIES(run_all_tests run_bsdtar_test) - SET_PROPERTY(GLOBAL APPEND PROPERTY ALL_TESTS run_bsdtar_test) ENDIF (ENABLE_TAR AND ENABLE_TEST)