Commit aa6d82ce authored by Juho Snellman's avatar Juho Snellman

Add a "make test" target

- Then add bizarro workarounds to get it to actually work. But hey,
  the issue for this has only been open in the bug tracker for 7
  years.
parent 290f5d33
......@@ -8,3 +8,20 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g3 -Wall -Werror -Wno-sign-c
add_executable(test_basic.testbin
src/test/test_basic.cc)
enable_testing()
add_test(test_basic bin/test_basic.testbin)
# CMake test support is a total shitshow. The test targets don't have
# a dependency on the test binary, and it's in fact impossible to add
# any dependencies at all for a test target. This means that "make
# test" will never do the right thing, but just run some random
# previously compiled versions.
#
# All the workarounds suck. This one seems to suck the least; add a
# test that builds the other tests, and then add this non-standard
# test-only sequencing dependency to force that test to run first.
add_test(build_test_code "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target all)
set_tests_properties(test_basic PROPERTIES DEPENDS build_test_code)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment