Fix return value of epicsUnitTest::testDone()

Wasn't properly returning a non-zero exit status
when HARNESS_ACTIVE was set.
This commit is contained in:
Andrew Johnson
2020-12-17 18:21:07 -06:00
parent 2035fc641a
commit a365de2419

View File

@@ -171,7 +171,12 @@ int testDone(void) {
epicsMutexMustLock(testLock);
if (perlHarness) {
if (!planned) printf("1..%d\n", tested);
if (!planned)
printf("1..%d\n", tested);
else if (tested != planned)
status = 2;
if (failed)
status |= 1;
} else {
if (planned && tested > planned) {
printf("\nRan %d tests but only planned for %d!\n", tested, planned);
@@ -186,7 +191,7 @@ int testDone(void) {
if (bonus) testResult("Todo Passes", bonus);
if (failed) {
testResult("Failed", failed);
status = 1;
status |= 1;
}
if (skipped) testResult("Skipped", skipped);
}