]> git.sthu.org Git - libstick.git/commitdiff
Enable ctest, fix exit status of tests/tests
authorStefan Huber <shuber@sthu.org>
Tue, 12 Nov 2013 16:18:12 +0000 (17:18 +0100)
committerStefan Huber <shuber@sthu.org>
Tue, 12 Nov 2013 16:18:12 +0000 (17:18 +0100)
CMakeLists.txt
tests/main.cc

index e6153031405e3cf7b57e2e334c62b27e54c42e7f..8969cb30776f56573a0ad2ceb95aa9ac4f12924c 100644 (file)
@@ -28,6 +28,8 @@ add_subdirectory(lib)
 
 if(WITH_UNITTESTS)
        add_subdirectory(tests)
+    enable_testing()
+    add_test(NAME unittests COMMAND tests)
 endif()
 
 
index 0b3dd996f1af959242a3b2efa6374e821c79b339..6016b3b511c6c2e707186bfe085c98f4526e0432 100644 (file)
@@ -19,6 +19,8 @@ int main(int argc, char* argv[]) {
     ts.add(auto_ptr<Test::Suite>(new persistence_TestSuite));
 
     Test::TextOutput output(Test::TextOutput::Verbose);
-    return ts.run(output);
+    if (ts.run(output))
+        return EXIT_SUCCESS;
+    return EXIT_FAILURE;
 }