db/test: Create a test harness for vxWorks & RTEMS

This commit is contained in:
Andrew Johnson
2012-05-29 16:20:17 -05:00
parent 385d9f007a
commit cdaf05c7ac
3 changed files with 51 additions and 3 deletions

View File

@@ -10,15 +10,22 @@ TOP=../../../..
include $(TOP)/configure/CONFIG
PROD_vxWorks += dbTestHarness
PROD_RTEMS += dbTestHarness
PROD_LIBS = dbCore ca Com
TESTPROD_HOST += callbackTest
callbackTest_SRCS += callbackTest.c
PROD_vxWorks += callbackTest
dbTestHarness_SRCS += callbackTest.c
TESTS += callbackTest
# When we add more test programs here, this must become a vxTestHarness
TESTSPEC_vxWorks = callbackTest.munch; callbackTest
dbTestHarness_SRCS += epicsRunDbTests.c
dbTestHarness_SRCS_RTEMS = rtemsTestHarness.c
TESTSPEC_vxWorks = dbTestHarness.munch; epicsRunDbTests
TESTSPEC_RTEMS = dbTestHarness.boot; epicsRunDbTests
TESTSCRIPTS_HOST += $(TESTS:%=%.t)

View File

@@ -0,0 +1,27 @@
/*************************************************************************\
* Copyright (c) 2011 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Run Db tests as a batch.
*
* Do not include performance measurements here, they don't prove
* functionality (which is the purpose of this convenience routine).
*/
#include "epicsUnitTest.h"
#include "epicsExit.h"
int callbackTest(void);
void epicsRunDbTests(void)
{
testHarness();
runTest(callbackTest);
epicsExit(0); /* Trigger test harness */
}

View File

@@ -0,0 +1,14 @@
/*************************************************************************\
* Copyright (c) 2011 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
extern void epicsRunDbTests(void);
int main(int argc, char **argv)
{
epicsRunDbTests(); /* calls epicsExit(0) */
return 0;
}