From 9e394a46c0d9d37cf2c49e1209369b0274a97980 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 30 Jul 2017 20:52:19 +0200 Subject: [PATCH] Drop cmake test logic and just run test.sh We had the situation that "make test" runs the test suite but does not show useful error messages (see https://github.com/vgough/encfs/issues/358 for an example). "make check" did the right thing by using the "--output-on-failure" feature, but depended on "make test" being available as well. This means users will continue to run "make test". This commits drops the cmake test logic and adds a dumb "make test" target that simply runs test.sh. --- .travis.yml | 2 +- CMakeLists.txt | 25 +------------------------ INSTALL.md | 2 +- test.sh | 2 ++ 4 files changed, 5 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index 463513bc..65c17947 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ before_script: - cmake --version script: - - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./build.sh && ./test.sh && make check -C build ; fi + - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./build.sh && ./test.sh ; fi addons: coverity_scan: diff --git a/CMakeLists.txt b/CMakeLists.txt index 81dbb388..2dd2f55d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,28 +233,5 @@ if (POD2MAN) DESTINATION share/man/man1) endif (POD2MAN) -# Tests -enable_testing() - -if (CMAKE_CONFIGURATION_TYPES) - add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} - --force-new-ctest-process --output-on-failure - --build-config "$") -else() - add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} - --force-new-ctest-process --output-on-failure) -endif() +add_custom_target(test COMMAND ${CMAKE_CURRENT_LIST_DIR}/test.sh) -add_test (NAME checkops - COMMAND checkops) - -find_program (PERL_PROGRAM perl) -if (PERL_PROGRAM) - file(GLOB pl_test_files "tests/*.t.pl") - add_test (NAME scriptedtests - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND ${PERL_PROGRAM} - -MTest::Harness - -e "$$Test::Harness::verbose=1; runtests @ARGV;" - ${pl_test_files}) -endif (PERL_PROGRAM) diff --git a/INSTALL.md b/INSTALL.md index 7ae48fab..8d0db649 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -21,7 +21,7 @@ Optional, but strongly recommended, is running the test suite to verify that the generated binaries work as expected (runtime: 20 seconds) - make check + make test The compilation process creates two executables, encfs and encfsctl in the encfs directory. You can install to in a system directory via diff --git a/test.sh b/test.sh index d9704e62..eb9f17fa 100755 --- a/test.sh +++ b/test.sh @@ -9,6 +9,8 @@ for i in $(mount | grep -e "/tmp/encfs-reverse-tests-\|/tmp/encfs-tests-" | cut fusermount -u $i || true done +set -x + # This is very noisy so run it silently at first. Run it again with # output if the first run fails. ./build/checkops &> /dev/null || ./build/checkops