This is still experimental and subject to change.
SVN-Revision: 1379
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)
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)
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)
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)