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 4, 2025
1 parent 110c536 commit 16e047f
Show file tree
Hide file tree
Showing 3 changed files with 18 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

INCLUDE += tap.h

CFG += RULES_GTEST
CFG += compat.RULES_BUILD

Expand Down
2 changes: 1 addition & 1 deletion sampleApp/mixdGtestEpicsSrc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TESTSCRIPTS_HOST += $(TESTS:%=%.t)
testHarness_SRCS += epicsRunSampleTests.c

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

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 16e047f

Please sign in to comment.