run unit tests with cmake's test target

This commit is contained in:
Valient Gough 2017-08-06 22:26:58 -04:00
parent 0111725d48
commit 24ce100696
No known key found for this signature in database
GPG Key ID: 33C65E29813C14DF
2 changed files with 4 additions and 1 deletions

View File

@ -278,6 +278,8 @@ if (POD2MAN)
endif (POD2MAN) endif (POD2MAN)
if (BUILD_UNIT_TESTS) if (BUILD_UNIT_TESTS)
enable_testing()
message("-- Including vendored googletest") message("-- Including vendored googletest")
set(GOOGLETEST_DIR vendor/github.com/google/googletest) set(GOOGLETEST_DIR vendor/github.com/google/googletest)
add_subdirectory(${GOOGLETEST_DIR}) add_subdirectory(${GOOGLETEST_DIR})
@ -292,6 +294,7 @@ if (BUILD_UNIT_TESTS)
file(GLOB_RECURSE TEST_SOURCES "encfs/*_test.cpp") file(GLOB_RECURSE TEST_SOURCES "encfs/*_test.cpp")
add_executable (unittests ${TEST_SOURCES}) add_executable (unittests ${TEST_SOURCES})
target_link_libraries(unittests gtest gtest_main encfs) target_link_libraries(unittests gtest gtest_main encfs)
add_test(unit unittests)
file(GLOB_RECURSE BENCH_SOURCES "encfs/*_bench.cpp") file(GLOB_RECURSE BENCH_SOURCES "encfs/*_bench.cpp")
add_executable (benchmarks ${BENCH_SOURCES}) add_executable (benchmarks ${BENCH_SOURCES})

View File

@ -10,5 +10,5 @@ dependencies:
test: test:
override: override:
- bash ./ci/config.sh - bash ./ci/config.sh
- cd build && make && ./checkops && make install - cd build && make && make test && ./checkops && make install
- /tmp/encfs/bin/encfsctl --version - /tmp/encfs/bin/encfsctl --version