From 597f168b9c037b172de4d46d0a77c515581e0439 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sun, 22 Nov 2020 11:53:44 -0800 Subject: [PATCH] fixup tests for RTEMS --- testApp/Makefile | 7 +++++++ testApp/remote/testServer.cpp | 2 +- testApp/remote/testServerContext.cpp | 15 +++++++-------- testApp/rtemsTestData.c | 2 ++ testApp/utils/Makefile | 6 +++--- 5 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 testApp/rtemsTestData.c diff --git a/testApp/Makefile b/testApp/Makefile index 36f3675..28f152e 100644 --- a/testApp/Makefile +++ b/testApp/Makefile @@ -16,6 +16,8 @@ PROD_SYS_LIBS_WIN32 += netapi32 ws2_32 include $(PVACCESS_TEST)/utils/Makefile include $(PVACCESS_TEST)/remote/Makefile +PROD_SRCS_RTEMS += rtemsTestData.c + # pvAccessAllTests runs all the test programs in a known working order. testHarness_SRCS += pvAccessAllTests.c @@ -34,4 +36,9 @@ TESTSPEC_RTEMS = pvaTestHarness.$(MUNCH_SUFFIX); pvAccessAllTests # Build test scripts for hosts TESTSCRIPTS_HOST += $(TESTS:%=%.t) +ifneq ($(filter $(T_A),$(CROSS_COMPILER_RUNTEST_ARCHS)),) +TESTPROD = $(TESTPROD_HOST) +TESTSCRIPTS += $(filter-out showauth,$(TESTS:%=%.t)) +endif + include $(TOP)/configure/RULES diff --git a/testApp/remote/testServer.cpp b/testApp/remote/testServer.cpp index 25436da..37ee9ac 100644 --- a/testApp/remote/testServer.cpp +++ b/testApp/remote/testServer.cpp @@ -2819,7 +2819,7 @@ int main(int argc, char *argv[]) .build())); TestServer::ctx = srv; srv->context->printInfo(); - srv->context->run(epics::pvData::castUnsafe(timeToRun)); + srv->context->run(epics::pvData::castUnsafe(timeToRun)); cout << "Done" << endl; diff --git a/testApp/remote/testServerContext.cpp b/testApp/remote/testServerContext.cpp index 77ed1f2..07bd359 100644 --- a/testApp/remote/testServerContext.cpp +++ b/testApp/remote/testServerContext.cpp @@ -8,6 +8,8 @@ #include +namespace { + using namespace epics::pvAccess; using namespace epics::pvData; using namespace std; @@ -61,8 +63,12 @@ public: } }; -void testServerContext() +} // namespace + +MAIN(testServerContext) { + testPlan(2); + ChannelProvider::shared_pointer prov(new TestChannelProvider); ServerContext::shared_pointer ctx(ServerContext::create(ServerContext::Config() .provider(prov))); @@ -77,13 +83,6 @@ void testServerContext() ctx.reset(); testOk(!wctx.lock(), "# ServerContext cleanup leaves use_count=%u", (unsigned)wctx.use_count()); -} - -MAIN(testServerContext) -{ - testPlan(2); - - testServerContext(); return testDone(); } diff --git a/testApp/rtemsTestData.c b/testApp/rtemsTestData.c new file mode 100644 index 0000000..76a0053 --- /dev/null +++ b/testApp/rtemsTestData.c @@ -0,0 +1,2 @@ +/* no test data */ +const void* epicsRtemsFSImage = 0; diff --git a/testApp/utils/Makefile b/testApp/utils/Makefile index 74aa6b7..c57c903 100644 --- a/testApp/utils/Makefile +++ b/testApp/utils/Makefile @@ -8,12 +8,12 @@ testHarness_SRCS += testAtomicBoolean.cpp TESTS += testAtomicBoolean TESTPROD_HOST += testHexDump -testHexDump = testHexDump.cpp +testHexDump_SRCS = testHexDump.cpp testHarness_SRCS += testHexDump.cpp TESTS += testHexDump TESTPROD_HOST += testInetAddressUtils -testInetAddressUtils = testInetAddressUtils.cpp +testInetAddressUtils_SRCS = testInetAddressUtils.cpp testHarness_SRCS += testInetAddressUtils.cpp TESTS += testInetAddressUtils @@ -27,7 +27,7 @@ testFairQueue_SRCS += testFairQueue TESTS += testFairQueue TESTPROD_HOST += testWildcard -testWildcard = testWildcard.cpp +testWildcard_SRCS = testWildcard.cpp testHarness_SRCS += testWildcard.cpp TESTS += testWildcard