errlog in tests

Take eltc(0) out of testPlan() and explicitly add it to those tests
that should suppress expected errlog output.
This commit is contained in:
Andrew Johnson
2012-07-06 17:47:56 -05:00
parent 0597f9c1c8
commit 3bfc6dcf64
4 changed files with 8 additions and 8 deletions

View File

@@ -65,7 +65,6 @@ void testPlan(int plan) {
planned = plan;
tested = passed = failed = skipped = bonus = 0;
todo = NULL;
eltc(0); /* Silence errlog output */
if (plan) printf("1..%d\n", plan);
epicsMutexUnlock(testLock);
}

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <string.h>
#include "errlog.h"
#include "epicsEvent.h"
#include "epicsExit.h"
#include "epicsMutex.h"
@@ -102,7 +103,7 @@ MAIN(epicsThreadOnceTest)
testOk(doneCount == NUM_ONCE_THREADS, "doneCount = %d", doneCount);
testDiag("init was run by %s", initBy);
testDiag("Expecting thread recurse to suspend:");
eltc(0);
tid = epicsThreadCreate("recurse", epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackSmall),
recurseThread, 0);
@@ -111,5 +112,6 @@ MAIN(epicsThreadOnceTest)
} while (!epicsThreadIsSuspended(tid));
testPass("Recursive epicsThreadOnce() detected");
eltc(1);
return testDone();
}

View File

@@ -21,15 +21,11 @@
#include "epicsUnitTest.h"
#include "testMain.h"
int warn;
static void check(const char *str, const char *expect)
{
char *got = macEnvExpand(str);
int pass = -1;
if (expect == NULL) ++warn;
if (expect && !got) {
testDiag("Got NULL, expected \"%s\".\n", expect);
pass = 0;
@@ -47,7 +43,7 @@ static void check(const char *str, const char *expect)
MAIN(macEnvExpandTest)
{
warn = 0;
eltc(0);
testPlan(71);
check("FOO", "FOO");
@@ -158,6 +154,6 @@ MAIN(macEnvExpandTest)
check("${FOO=$(BAR),BAR=$(FOO)}", NULL);
errlogFlush();
testDiag("%d warning messages from macLib were expected above.\n", warn);
eltc(1);
return testDone();
}

View File

@@ -13,6 +13,7 @@
#include <stdio.h>
#include "taskwd.h"
#include "errlog.h"
#include "epicsThread.h"
#include "epicsUnitTest.h"
#include "testMain.h"
@@ -66,6 +67,7 @@ void testTask2(void *arg)
MAIN(taskwdTest)
{
eltc(0);
testPlan(8);
taskwdInit();
@@ -87,6 +89,7 @@ MAIN(taskwdTest)
taskwdMonitorDel(&monFuncs, NULL);
taskwdAnyRemove(NULL);
eltc(1);
return testDone();
}