From 80a537bc4c76c96cc8607f9340f50d9c67acd8ce Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Fri, 31 Oct 2014 07:57:20 -0400 Subject: [PATCH] vxWork tests for all subtests; still need to combine them all to one --- testApp/Makefile | 8 +++++ testApp/copy/Makefile | 20 ++++++++++--- testApp/copy/epicsRunPVDataTests.c | 22 ++++++++++++++ testApp/copy/testCreateRequest.cpp | 4 +-- testApp/misc/Makefile | 24 +++++++++++++++ testApp/misc/epicsRunPVDataTests.c | 41 ++++++++++++++++++++++++++ testApp/misc/testBaseException.cpp | 4 +-- testApp/misc/testOverrunBitSet.cpp | 2 +- testApp/misc/testTimeStamp.cpp | 4 +-- testApp/property/Makefile | 15 +++++++++- testApp/property/epicsRunPVDataTests.c | 20 +++++++++++++ testApp/pv/epicsRunPVDataTests.c | 24 +++++++-------- 12 files changed, 164 insertions(+), 24 deletions(-) create mode 100644 testApp/copy/epicsRunPVDataTests.c create mode 100644 testApp/misc/epicsRunPVDataTests.c create mode 100644 testApp/property/epicsRunPVDataTests.c diff --git a/testApp/Makefile b/testApp/Makefile index 6d49e69..fa71872 100644 --- a/testApp/Makefile +++ b/testApp/Makefile @@ -4,5 +4,13 @@ DIRS += misc DIRS += pv DIRS += property DIRS += copy + +# TODO combined test vxTestHarness +#PROD_vxWorks = vxTestHarness +#vxTestHarness_SRCS += pvDataAllTests +#vxTestHarness_OBJS += misc/ +#TESTSPEC_vxWorks = vxTestHarness.$(MUNCH_SUFFIX); pvDataAllTests + include $(TOP)/configure/RULES_DIRS + diff --git a/testApp/copy/Makefile b/testApp/copy/Makefile index 1b1301b..21e998b 100644 --- a/testApp/copy/Makefile +++ b/testApp/copy/Makefile @@ -2,20 +2,32 @@ TOP=../.. include $(TOP)/configure/CONFIG +PROD_LIBS += pvData Com + TESTPROD_HOST += testCreateRequest testCreateRequest_SRCS = testCreateRequest.cpp -testCreateRequest_LIBS = pvData Com +testHarness_SRCS += testCreateRequest.cpp TESTS += testCreateRequest TESTPROD_HOST += testPVCopy testPVCopy_SRCS += testPVCopy.cpp -testPVCopy_LIBS += pvData Com +testHarness_SRCS += testPVCopy.cpp TESTS += testPVCopy +# The testHarness runs all the test programs in a known working order. +testHarness_SRCS += epicsRunPVDataTests.c + +PROD_vxWorks = vxTestHarness +vxTestHarness_SRCS += $(testHarness_SRCS) +TESTSPEC_vxWorks = vxTestHarness.$(MUNCH_SUFFIX); epicsRunPVDataTests.c + +#PROD_RTEMS += rtemsTestHarness +#rtemsTestHarness_SRCS += rtemsTestHarness.c +#rtemsTestHarness_SRCS += $(testHarness_SRCS) +#TESTSPEC_RTEMS = rtemsTestHarness.boot; epicsRunPVDataTests.c + TESTSCRIPTS_HOST += $(TESTS:%=%.t) - - include $(TOP)/configure/RULES #---------------------------------------- # ADD RULES AFTER THIS LINE diff --git a/testApp/copy/epicsRunPVDataTests.c b/testApp/copy/epicsRunPVDataTests.c new file mode 100644 index 0000000..0530a6e --- /dev/null +++ b/testApp/copy/epicsRunPVDataTests.c @@ -0,0 +1,22 @@ +/* + * Run pvData tests as a batch. + * + * Do *not* include performance measurements here, they don't help to + * prove functionality (which is the point of this convenience routine). + */ + +#include +#include +#include + +int testCreateRequest(void); +int testPVCopy(void); + +void epicsRunPVDataTests(void) +{ + testHarness(); + + runTest(testCreateRequest); + runTest(testPVCopy); + +} diff --git a/testApp/copy/testCreateRequest.cpp b/testApp/copy/testCreateRequest.cpp index e957fc1..3c0db1c 100644 --- a/testApp/copy/testCreateRequest.cpp +++ b/testApp/copy/testCreateRequest.cpp @@ -20,7 +20,7 @@ using std::endl; static bool debug = false; -static void testCreateRequest() { +static void testCreateRequestInternal() { printf("testCreateRequest... \n"); CreateRequest::shared_pointer createRequest = CreateRequest::create(); PVStringPtr pvString; @@ -307,7 +307,7 @@ static void testCreateRequest() { MAIN(testCreateRequest) { testPlan(117); - testCreateRequest(); + testCreateRequestInternal(); return testDone(); } diff --git a/testApp/misc/Makefile b/testApp/misc/Makefile index 30bf7dc..d4e4004 100644 --- a/testApp/misc/Makefile +++ b/testApp/misc/Makefile @@ -6,18 +6,22 @@ PROD_LIBS += pvData Com TESTPROD_HOST += testThread testThread_SRCS += testThread.cpp +testHarness_SRCS += testThread.cpp TESTS += testThread TESTPROD_HOST += testTimer testTimer_SRCS += testTimer.cpp +testHarness_SRCS += testTimer.cpp TESTS += testTimer TESTPROD_HOST += testBitSet testBitSet_SRCS += testBitSet.cpp +testHarness_SRCS += testBitSet.cpp TESTS += testBitSet TESTPROD_HOST += testOverrunBitSet testOverrunBitSet_SRCS += testOverrunBitSet.cpp +testHarness_SRCS += testOverrunBitSet.cpp TESTS += testOverrunBitSet TESTPROD_HOST += testByteOrder @@ -25,36 +29,56 @@ testByteOrder_SRCS += testByteOrder.cpp TESTPROD_HOST += testByteBuffer testByteBuffer_SRCS += testByteBuffer.cpp +testHarness_SRCS += testByteBuffer.cpp TESTS += testByteBuffer TESTPROD_HOST += testBaseException testBaseException_SRCS += testBaseException.cpp +testHarness_SRCS += testBaseException.cpp TESTS += testBaseException TESTPROD_HOST += testSharedVector testSharedVector_SRCS += testSharedVector.cpp +testHarness_SRCS += testSharedVector.cpp TESTS += testSharedVector TESTPROD_HOST += testSerialization testSerialization_SRCS += testSerialization.cpp +testHarness_SRCS += testSerialization.cpp TESTS += testSerialization TESTPROD_HOST += testTimeStamp testTimeStamp_SRCS += testTimeStamp.cpp +testHarness_SRCS += testTimeStamp.cpp TESTS += testTimeStamp TESTPROD_HOST += testQueue testQueue_SRCS += testQueue.cpp +testHarness_SRCS += testQueue.cpp TESTS += testQueue TESTPROD_HOST += testMessageQueue testMessageQueue_SRCS += testMessageQueue.cpp +testHarness_SRCS += testMessageQueue.cpp TESTS += testMessageQueue TESTPROD_HOST += testTypeCast testTypeCast_SRCS += testTypeCast.cpp +testHarness_SRCS += testTypeCast.cpp TESTS += testTypeCast +# The testHarness runs all the test programs in a known working order. +testHarness_SRCS += epicsRunPVDataTests.c + +PROD_vxWorks = vxTestHarness +vxTestHarness_SRCS += $(testHarness_SRCS) +TESTSPEC_vxWorks = vxTestHarness.$(MUNCH_SUFFIX); epicsRunPVDataTests + +#PROD_RTEMS += rtemsTestHarness +#rtemsTestHarness_SRCS += rtemsTestHarness.c +#rtemsTestHarness_SRCS += $(testHarness_SRCS) +#TESTSPEC_RTEMS = rtemsTestHarness.boot; epicsRunPVDataTests + TESTSCRIPTS_HOST += $(TESTS:%=%.t) include $(TOP)/configure/RULES diff --git a/testApp/misc/epicsRunPVDataTests.c b/testApp/misc/epicsRunPVDataTests.c new file mode 100644 index 0000000..8871bb1 --- /dev/null +++ b/testApp/misc/epicsRunPVDataTests.c @@ -0,0 +1,41 @@ +/* + * Run pvData tests as a batch. + * + * Do *not* include performance measurements here, they don't help to + * prove functionality (which is the point of this convenience routine). + */ + +#include +#include +#include + +int testBaseException(void); +int testBitSet(void); +int testByteBuffer(void); +int testMessageQueue(void); +int testOverrunBitSet(void); +int testQueue(void); +int testSerialization(void); +int testSharedVector(void); +int testThread(void); +int testTimeStamp(void); +int testTimer(void); +int testTypeCast(void); + +void epicsRunPVDataTests(void) +{ + testHarness(); + + runTest(testBaseException); + runTest(testBitSet); + runTest(testByteBuffer); + runTest(testMessageQueue); + runTest(testOverrunBitSet); + runTest(testQueue); + runTest(testSerialization); + runTest(testSharedVector); + runTest(testThread); + runTest(testTimeStamp); + runTest(testTimer); + runTest(testTypeCast); +} diff --git a/testApp/misc/testBaseException.cpp b/testApp/misc/testBaseException.cpp index dad14d5..dcbf02c 100644 --- a/testApp/misc/testBaseException.cpp +++ b/testApp/misc/testBaseException.cpp @@ -42,7 +42,7 @@ void internalTestBaseException(int /*unused*/ = 0) } } -void testBaseException() { +void testBaseExceptionTest() { printf("testBaseException... "); try { @@ -86,7 +86,7 @@ MAIN(testBaseException) testPlan(2); testDiag("Tests base exception"); testLogicException(); - testBaseException(); + testBaseExceptionTest(); return testDone(); } diff --git a/testApp/misc/testOverrunBitSet.cpp b/testApp/misc/testOverrunBitSet.cpp index 0b8c778..0c0d560 100644 --- a/testApp/misc/testOverrunBitSet.cpp +++ b/testApp/misc/testOverrunBitSet.cpp @@ -132,7 +132,7 @@ void test() } -MAIN(testOverrunBitSet`) +MAIN(testOverrunBitSet) { testPlan(41); testDiag("Tests for changeBitSet and overrunBitSet"); diff --git a/testApp/misc/testTimeStamp.cpp b/testApp/misc/testTimeStamp.cpp index 0284724..c7bfd53 100644 --- a/testApp/misc/testTimeStamp.cpp +++ b/testApp/misc/testTimeStamp.cpp @@ -28,7 +28,7 @@ using namespace epics::pvData; static bool debug = false; -void testTimeStamp() +void testTimeStampInternal() { testOk1(nanoSecPerSec==1000000000); TimeStamp current; @@ -131,6 +131,6 @@ MAIN(testTimeStamp) { testPlan(37); testDiag("Tests timeStamp"); - testTimeStamp(); + testTimeStampInternal(); return testDone(); } diff --git a/testApp/property/Makefile b/testApp/property/Makefile index 5daa114..67c1aec 100644 --- a/testApp/property/Makefile +++ b/testApp/property/Makefile @@ -2,11 +2,24 @@ TOP=../.. include $(TOP)/configure/CONFIG +PROD_LIBS = pvData Com + TESTPROD_HOST += testProperty testProperty_SRCS += testProperty.cpp +testHarness_SRCS += testProperty.cpp TESTS += testProperty -testProperty_LIBS += pvData Com +# The testHarness runs all the test programs in a known working order. +testHarness_SRCS += epicsRunPVDataTests.c + +PROD_vxWorks = vxTestHarness +vxTestHarness_SRCS += $(testHarness_SRCS) +TESTSPEC_vxWorks = vxTestHarness.$(MUNCH_SUFFIX); epicsRunPVDataTests + +#PROD_RTEMS += rtemsTestHarness +#rtemsTestHarness_SRCS += rtemsTestHarness.c +#rtemsTestHarness_SRCS += $(testHarness_SRCS) +#TESTSPEC_RTEMS = rtemsTestHarness.boot; epicsRunPVDataTests TESTSCRIPTS_HOST += $(TESTS:%=%.t) diff --git a/testApp/property/epicsRunPVDataTests.c b/testApp/property/epicsRunPVDataTests.c new file mode 100644 index 0000000..e9946dc --- /dev/null +++ b/testApp/property/epicsRunPVDataTests.c @@ -0,0 +1,20 @@ +/* + * Run pvData tests as a batch. + * + * Do *not* include performance measurements here, they don't help to + * prove functionality (which is the point of this convenience routine). + */ + +#include +#include +#include + +int testCreateRequest(void); + +void epicsRunPVDataTests(void) +{ + testHarness(); + + runTest(testCreateRequest); + +} diff --git a/testApp/pv/epicsRunPVDataTests.c b/testApp/pv/epicsRunPVDataTests.c index 0c3d65b..d79fc72 100644 --- a/testApp/pv/epicsRunPVDataTests.c +++ b/testApp/pv/epicsRunPVDataTests.c @@ -9,18 +9,18 @@ #include #include -int testBitSetUtil(int); -int testConvert(int); -int testFieldBuilder(int); -int testIntrospect(int); -int testOperators(int); -int testPVData(int); -int testPVScalarArray(int); -int testPVStructureArray(int); -int testPVType(int); -int testPVUnion(int); -int testStandardField(int); -int testStandardPVField(int); +int testBitSetUtil(void); +int testConvert(void); +int testFieldBuilder(void); +int testIntrospect(void); +int testOperators(void); +int testPVData(void); +int testPVScalarArray(void); +int testPVStructureArray(void); +int testPVType(void); +int testPVUnion(void); +int testStandardField(void); +int testStandardPVField(void); void epicsRunPVDataTests(void) {