From: Stefan Huber Date: Tue, 12 Nov 2013 16:18:12 +0000 (+0100) Subject: Enable ctest, fix exit status of tests/tests X-Git-Tag: v0.1~23 X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=1ee4f2d8184655e56afbeba5b9b7233539e79e24;p=libstick.git Enable ctest, fix exit status of tests/tests --- 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; }