potential fix for unit/integ test false positives

This commit is contained in:
Nick Bolton 2014-02-24 13:45:43 +00:00
parent ad35ccb2dc
commit 77676d558e
2 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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;
}