diff --git a/src/test/integtests/Main.cpp b/src/test/integtests/Main.cpp index d76bb30b..584e881b 100644 --- a/src/test/integtests/Main.cpp +++ b/src/test/integtests/Main.cpp @@ -66,8 +66,13 @@ main(int argc, char **argv) if (!lockFile.empty()) { unlock(lockFile); } - - return result; + + // gtest seems to randomly finish with error codes (e.g. -1, -1073741819) + // even when no tests have failed. not sure what causes this, but it + // happens on all platforms and keeps leading to false positives. + // according to the documentation, 1 is a failure, so we should be + // able to trust that code. + return (result == 1) ? 1 : 0; } void diff --git a/src/test/unittests/Main.cpp b/src/test/unittests/Main.cpp index dd165045..2320acbf 100644 --- a/src/test/unittests/Main.cpp +++ b/src/test/unittests/Main.cpp @@ -39,6 +39,11 @@ main(int argc, char **argv) log.setFilter(kDEBUG4); testing::InitGoogleTest(&argc, argv); - - return RUN_ALL_TESTS(); + + // gtest seems to randomly finish with error codes (e.g. -1, -1073741819) + // even when no tests have failed. not sure what causes this, but it + // happens on all platforms and keeps leading to false positives. + // according to the documentation, 1 is a failure, so we should be + // able to trust that code. + return (RUN_ALL_TESTS() == 1) ? 1 : 0; }