Skip to content

Commit

Permalink
WIP run gtests under RTEMS
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphlange committed Jan 5, 2025
1 parent 110c536 commit a7f7cd3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 2 additions & 0 deletions gtestSup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ epics_gtest_main_LIBS += gmock gtest

PERL_SCRIPTS += testSuiteList.pl

INC += tap.h

CFG += RULES_GTEST
CFG += compat.RULES_BUILD

Expand Down
7 changes: 6 additions & 1 deletion sampleApp/mixdGtestEpicsSrc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ PROD_LIBS = $(EPICS_BASE_IOC_LIBS)

GTESTPROD_HOST += gsample1
gsample1_SRCS += gsample1.cpp
testHarness_SRCS += gsample1.cpp
GTESTS += gsample1

GTESTPROD_HOST += gsample2
gsample2_SRCS += gsample2.cpp
testHarness_SRCS += gsample2.cpp
GTESTS += gsample2

GTESTPROD_HOST += gsample3
gsample3_SRCS += gsample3.cpp
testHarness_SRCS += gsample3.cpp
GTESTS += gsample3

#=============================
Expand Down Expand Up @@ -69,7 +72,9 @@ TESTSCRIPTS_HOST += $(TESTS:%=%.t)
testHarness_SRCS += epicsRunSampleTests.c

sampleTestHarness_SRCS += $(testHarness_SRCS)
sampleTestHarness_SRCS_RTEMS += rtemsTestHarness.c
sampleTestHarness_SRCS_RTEMS += rtemsTestHarness.cpp

sampleTestHarness_LIBS += gmock gtest

PROD_vxWorks = sampleTestHarness
PROD_RTEMS += sampleTestHarness
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,23 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/

extern void epicsRunSampleTests(void);
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <tap.h>

extern "C" void epicsRunSampleTests(void);

int main(int argc, char **argv)
{
bool addTapListener = true;

epicsRunSampleTests(); /* calls epicsExit(0) */
return 0;

testing::InitGoogleMock(&argc, argv);

if (addTapListener) {
testing::TestEventListeners& listeners = testing::UnitTest::GetInstance()->listeners();
listeners.Append(new tap::TapListener());
}
return RUN_ALL_TESTS();
}

0 comments on commit a7f7cd3

Please sign in to comment.