From 1ee4f2d8184655e56afbeba5b9b7233539e79e24 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 12 Nov 2013 17:18:12 +0100 Subject: [PATCH] Enable ctest, fix exit status of tests/tests --- CMakeLists.txt | 2 ++ tests/main.cc | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e615303..8969cb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,8 @@ add_subdirectory(lib) if(WITH_UNITTESTS) add_subdirectory(tests) + enable_testing() + add_test(NAME unittests COMMAND tests) endif() diff --git a/tests/main.cc b/tests/main.cc index 0b3dd99..6016b3b 100644 --- a/tests/main.cc +++ b/tests/main.cc @@ -19,6 +19,8 @@ int main(int argc, char* argv[]) { ts.add(auto_ptr(new persistence_TestSuite)); Test::TextOutput output(Test::TextOutput::Verbose); - return ts.run(output); + if (ts.run(output)) + return EXIT_SUCCESS; + return EXIT_FAILURE; } -- 2.39.5