Skip to content

Commit f7033e0

Browse files
committed
#f8ac9dd alternate C/C++ unit test framework support
Integrated patch from Anointe Laydier. Probably still some issues and bad interaction with cross compile feature (XARCH variable use)
1 parent 7c6aab4 commit f7033e0

File tree

7 files changed

+317
-105
lines changed

7 files changed

+317
-105
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<cr id="f8ac9dd1894939fba32d851acb9330d277eb74ca78a2a7bcd7042b182d689224" state="open">
2+
<cr id="f8ac9dd1894939fba32d851acb9330d277eb74ca78a2a7bcd7042b182d689224" state="working">
33
<title>alternate unit test framework support</title>
44
<reporter>m026258</reporter>
55
<creation>2025-07-25 18:22:11+02:00</creation>
66
<description></description>
77
<links>
88
<link name="parent">7bc74cc796c455a46d699ad91f6aca5b7c790f56a6a0968b4ecbce33efce9d25</link>
99
</links>
10-
<cf v="null"/>
10+
<cf v="Sebastien Devaux 2025-07-25T18:24:39+02:00"/>
1111
</cr>

core/module-junit.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
##
77
## - JUNIT: junit package name (default is junit-4.8.2)
88
## - TARGS: run only test class with name containing the string given with this variable.
9-
JUNIT?=junit-4.8.2
10-
JUNITXML?=junitXmlFormatter-0.0
9+
JUNIT?=junit|4.8.2
10+
JUNITXML?=junitXmlFormatter|0.0
1111

12-
JUNIT_JAR_FILE=$(ABS_CACHE)/noarch/$(JUNIT).jar
13-
JUNITXML_JAR_FILE=$(ABS_CACHE)/noarch/$(JUNITXML).jar
12+
JUNIT_JAR_FILE=$(ABS_CACHE)/noarch/$(subst |,-,$(JUNIT)).jar
13+
JUNITXML_JAR_FILE=$(ABS_CACHE)/noarch/$(subst |,-,$(JUNITXML)).jar
1414

1515
TXTXSL=xunit2txt.xsl
1616
TESTCLASSFILES=$(patsubst %.java,$(OBJDIR)/%.class,$(shell find test -name "Test*.java" 2>/dev/null))

core/module-test.mk

Lines changed: 56 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,39 @@
55
##
66
## Test services variables
77
##
8-
## - CPPUNIT: cppunit version. Default is set accorging your gcc version
9-
## - 1.14.0 for gcc >= 6.0
10-
## - 1.12.1 for gcc < 6.0
11-
## - TUSEMOD: The other mods of the project to link for the tests.
8+
## - CPP_UNIT_TESTER: Unit tester, choose one of:
9+
## - cppunit
10+
## - googletest
11+
## - geod
12+
## cppunit is the default.
13+
## - TUSEMOD: The other mods of the project to link for the tests.
1214
## - TLINKLIB: List of libraries to link for tests.
1315
## - TCFLAGS: CFLAGS used for tests compilation
1416
## - TLDFLAGS: LDFLAGS used for tests linkage
1517
## - TDISABLE_SRC: List of files in test directory to not compile
1618
##
1719
## ------------------------------------------------------------------------
18-
ifeq ($(filter %-win32 %-posix,$(CC_VERSION)),)
19-
CC_VERSION_GE6:=$(shell [ `echo "$(CC_VERSION)" | cut -f1 -d.` -ge 6 ] && echo true || echo false)
20-
ifeq ($(CC_VERSION_GE6),false)
21-
CPPUNIT?=cppunit|1.12.1
22-
endif
23-
endif
24-
CPPUNIT?=cppunit|1.14.0
25-
26-
TESTRUNNER=ctrunner$(BINEXT)
27-
TXTXSL=xunit2txt.xsl
28-
# default TIMEOUT 10min
29-
TIMEOUT?=600
30-
ifeq ($(COLORS_TCAP),yes)
31-
TIMEOUTCMD:=
32-
else
33-
TIMEOUTCMD:=timeout $(TIMEOUT)
34-
endif
3520

36-
CPPUNIT_DIR=$(call GetExtLibDir,$(NDEXTLIBDIR),$(CPPUNIT))
37-
TCFLAGS+=-I$(CPPUNIT_DIR)/include
38-
TLDFLAGS+=-L$(CPPUNIT_DIR)/$(SODIR)
39-
TLINKLIB+=cppunit
21+
CPP_UNIT_TESTER?=cppunit
22+
# include selected test tool definitions
23+
include $(ABSROOT)/core/xunit/$(CPP_UNIT_TESTER).mk
4024

4125
# valgrind
4226
VALGRIND=valgrind
4327

4428
# Target definition.
45-
TTARGETFILE=$(TTARGETDIR)/t_$(TARGET)
4629
ifeq ($(ISWINDOWS),true)
47-
TCYGTARGET=$(TTARGETDIR)/t_$(CYGTARGET)
30+
ifeq ($(DYNAMIC_LIB),true)
31+
TCYGTARGET=$(TTARGETDIR)/t_$(CYGTARGET)
32+
else
33+
TCYGTARGET=$(TTARGETDIR)/t_$(subst $(SOEXT),$(AREXT),$(CYGTARGET))
34+
endif
35+
else
36+
ifeq ($(DYNAMIC_LIB),true)
37+
TTARGETFILE=$(TTARGETDIR)/t_$(TARGET)
38+
else
39+
TTARGETFILE=$(TTARGETDIR)/t_$(subst $(SOEXT),$(AREXT),$(TARGET))
40+
endif
4841
endif
4942
TARGETFILES+=$(TTARGETFILE)
5043

@@ -66,7 +59,12 @@ TCFLAGS+=$(patsubst %,-I$(PRJROOT)/%/include,$(INCLUDE_TESTMODS_PROJ))
6659

6760
# linker options specific to test
6861
TLDFLAGS+=-L$(TRDIR)/$(SODIR)
62+
ifeq ($(DYNAMIC_LIB),true)
6963
TLDFLAGS+=$(patsubst %,-l%,$(call GetExistingModGeneratedSO,$(TESTUSEMOD)))
64+
endif
65+
ifeq ($(STATIC_LIB),true)
66+
TLDFLAGS+=$(patsubst %,-l%,$(call GetExistingModGeneratedArchive,$(TESTUSEMOD)))
67+
endif
7068
TLDFLAGS+=$(patsubst %,-l%,$(TLINKLIB))
7169

7270
INCLUDE_TESTMODS_EXT=$(filter-out $(PROJECT_INC_MODS),$(sort $(T_ALL_DEPENDENCIES)))
@@ -118,22 +116,22 @@ TLDLIBP=$(LDLIBP):$(subst $(_space_),:,$(patsubst -L%,%,$(filter -L%,$(TLDFLAGS)
118116
$(OBJDIR)/test/%.o: test/%.cpp
119117
@$(ABS_PRINT_info) "Compiling test $< ..."
120118
@mkdir -p $(@D)
121-
@$(call writeToBuildLogs,$(CPPC) $(CXXFLAGS) $(CFLAGS) $(TCFLAGS) -c $< -o $@)
122-
# generation of header for cppunit tests definition. Remove one line defines to avoid resolving them now.
123-
@grep -v "#\s*include" $< | grep -v -E "#\s*define.*[^\]$$" | $(CPPC) -x c++ -E - |\
124-
grep -E "ABS_TEST_.*_BEGIN|ABS_TEST_SUITE_END" | sed -E 's/\{ *$$//g' |\
125-
$(CPPC) -x c++ -E -include $(ABSROOT)/core/include/abs/testdef2cppunitdecl.h - |\
126-
sed -e '/^#/d;s/!$$//g;s/ !!!/\n!!!/g;s/!!!/#/g' > $(patsubst %.o,%.h,$@)
127-
$(gen-json-test-cppc)
128-
@$(CPPC) $(CXXFLAGS) $(CFLAGS) $(TCFLAGS) -include $(patsubst %.o,%.h,$@) $(GEN_DEP_FLAGS) -c $< -o $@
119+
@$(call writeToBuildLogs,$(CPPC) $(CXXFLAGS) $(CFLAGS) $(TCFLAGS) $(TCXXFLAGS) -c $< -o $@)
120+
$(pre_compile_cpp_test)
121+
ifeq ($(wildcard $(patsubst %.o,%.h,$@)),$(patsubst %.o,%.h,$@))
122+
@$(CPPC) $(CXXFLAGS) $(TCXXFLAGS) $(CFLAGS) $(TCFLAGS) -include $(patsubst %.o,%.h,$@) $(GEN_DEP_FLAGS) -c $< -o $@
123+
else
124+
@$(CPPC) $(CXXFLAGS) $(TCXXFLAGS) $(CFLAGS) $(TCFLAGS) $(GEN_DEP_FLAGS) -c $< -o $@
125+
endif
126+
129127
ifeq ($(ISWINDOWS),true)
130128
$(win-patch-dep)
131129
endif
132130

133131
$(OBJDIR)/test/%.o: test/%.c
134132
@$(ABS_PRINT_info) "Compiling test $< ..."
135133
@mkdir -p $(@D)
136-
$(gen-json-test-cc)
134+
$(pre_compile_c_test)
137135
@$(call executeAndLogCmd,$(CC) $(CFLAGS) $(TCFLAGS) $(GEN_DEP_FLAGS) -c $< -o $@)
138136
ifeq ($(ISWINDOWS),true)
139137
$(win-patch-dep)
@@ -150,7 +148,11 @@ $(OBJDIR)/bintest/%.o: $(OBJDIR)/%.o
150148
endif
151149

152150
ifneq ($(filter exe library,$(MODTYPE)),)
153-
TTARGETFILEDEP:=$(TARGETFILE)
151+
ifeq ($(DYNAMIC_LIB),true)
152+
TTARGETFILEDEP:=$(TARGETFILE)
153+
else
154+
TTARGETFILEDEP:=$(subst $(SOEXT),$(AREXT),$(TARGETFILE))
155+
endif
154156
endif
155157

156158
# link main lib dependencies too (in case the main lib is not directly used.)
@@ -160,14 +162,16 @@ ifneq ($(PREPROC_ONLY),true)
160162
ifneq ($(ISWINDOWS),true)
161163
define ld-test
162164
@$(ABS_PRINT_info) "Linking $@ ..."
165+
@$(call updateOptionsAndFlags, OPTIONSANDFLAGS, $(LDFLAGS), $(TLDFLAGS), $@)
163166
@$(call writeToBuildLogs,t_$(MODNAME) linked to $(sort $(patsubst -l%,%,$(TLDFLAGS_L))))
164-
@$(call executeAndLogCmd,$(LD) -o $@ $(TCPPOBJS) $(LDFLAGS) $(TLDFLAGS))
167+
@$(call executeAndLogCmd,$(LD) -o $@ $(TCPPOBJS) $(OPTIONSANDFLAGS))
165168
endef
166169
else
167170
define ld-test
168171
@$(ABS_PRINT_info) "Linking $(TCYGTARGET) ..."
172+
@$(call updateOptionsAndFlags, OPTIONSANDFLAGS, $(LDFLAGS), $(TLDFLAGS), $@)
169173
@$(call writeToBuildLogs,t_$(MODNAME) linked to $(sort $(patsubst -l%,%,$(TLDFLAGS_L))))
170-
@$(call executeAndLogCmd,$(LD) -shared -o $(TCYGTARGET) $(call getWindowsLibLDFlags,$@,$(TCPPOBJS)) $(LDFLAGS) $(TLDFLAGS))
174+
@$(call executeAndLogCmd,$(LD) -o $(TCYGTARGET) $(call getWindowsLibLDFlags,$@,$(TCPPOBJS)) $(OPTIONSANDFLAGS))
171175
endef
172176
endif
173177
else
@@ -177,19 +181,26 @@ endef
177181
endif
178182

179183
# link test target from test objects.
180-
$(TTARGETFILE): $(TCPPOBJS) $(TTARGETFILEDEP)
184+
$(TTARGETFILE): $(TCPPOBJS) $(TTARGETFILEDEP) $(LD_SCRIPT)
181185
@mkdir -p $(@D)
182-
@$(ld-test)
186+
@$(ld-test) $(LD_APPEND)
183187

184188
# CPPUNIT must be added before following rules to recompute $(EXTLIBMAKES)
185189
NDUSELIB+=$(CPPUNIT)
190+
ifneq ($(XARCH),)
191+
# TODO: Unsure, NDXA_USELIB not define previously (not well reported everything from Antoine)...
192+
NDXA_USELIB+=$(CPP_UNIT_TESTER_LIB)
193+
else
194+
NDUSELIB+=$(CPP_UNIT_TESTER_LIB)
195+
endif
196+
186197
# ---------------------------------------------------------------------
187198
# Extra dependencies
188199
# ---------------------------------------------------------------------
189200
# Generating test object need cppunit libs and tools to be availables
190201
$(TCPPOBJS): $(EXTLIBMAKES)
191202

192-
ifneq ($(wildcard test/Main.cpp),)
203+
ifneq ($(ARE_TESTS_AVAILABLE),)
193204

194205
# Variable to handle the filter of some test files defined in FILTER_TEST_FILES.
195206
# The files in FILTER_TEST_FILES must start with 'test/'.
@@ -222,21 +233,15 @@ WINEFULLPATH=$(TRDIR)/bin;$(subst :,;,$(TLDLIBP))
222233
ifneq ($(ISWINDOWS),true)
223234
define exec-test
224235
@$(RUNTIME_PROLOG)
225-
@( [ -d test ] && PATH="$(RUNPATH)" LD_LIBRARY_PATH="$(TLDLIBP)" WINEPATH="$(WINEFULLPATH);$$WINEPATH" TRDIR="$(TRDIR)" TTARGETDIR="$(TTARGETDIR)" LD_PRELOAD="$(TLDPRELOADFORMATTED)" $(RUNTIME_ENV) $1 $(ARCH_EXECUTOR) $(CPPUNIT_DIR)/bin/$(TESTRUNNER) -x $(TEST_REPORT_PATH) $(TTARGETFILE) $(RUNARGS) $(patsubst %,+f %,$(T)) $(TARGS) 2>&1 | tee $(TTARGETDIR)/$(APPNAME)_$(MODNAME).stdout ) || :
236+
@( [ -d test ] && PATH="$(RUNPATH)" LD_LIBRARY_PATH="$(TLDLIBP)" WINEPATH="$(WINEFULLPATH);$$WINEPATH" TRDIR="$(TRDIR)" TTARGETDIR="$(TTARGETDIR)" LD_PRELOAD="$(TLDPRELOADFORMATTED)" $(RUNTIME_ENV) $1 $(ARCH_EXECUTOR) $(TEST_RUNNER_CMD) $(TTARGETFILE) $(TEST_RUNNER_ARG_XML)$(TEST_REPORT_PATH) $(RUNARGS) $(patsubst %,+f %,$(T)) $(TARGS) 2>&1 | tee $(TTARGETDIR)/$(APPNAME)_$(MODNAME).stdout ) || :
226237
@$(RUNTIME_EPILOG)
227238
endef
228239
else
229240
define exec-test
230-
@( [ -d test ] && PATH="$(RUNPATH):$(TLDLIBP)" LD_LIBRARY_PATH="$(TLDLIBP)" WINEPATH="$(WINEFULLPATH);$$WINEPATH" TRDIR="$(TRDIR)" TTARGETDIR="$(TTARGETDIR)" LD_PRELOAD="$(TLDPRELOADFORMATTED)" $(RUNTIME_ENV) $1 $(ARCH_EXECUTOR) $(CPPUNIT_DIR)/bin/$(TESTRUNNER) -x $(TEST_REPORT_PATH) $(TCYGTARGET) $(RUNARGS) $(patsubst %,+f %,$(T)) $(TARGS) 2>&1 | tee $(TTARGETDIR)/$(APPNAME)_$(MODNAME).stdout ) || true
241+
@( [ -d test ] && PATH="$(RUNPATH):$(TLDLIBP)" LD_LIBRARY_PATH="$(TLDLIBP)" WINEPATH="$(WINEFULLPATH);$$WINEPATH" TRDIR="$(TRDIR)" TTARGETDIR="$(TTARGETDIR)" LD_PRELOAD="$(TLDPRELOADFORMATTED)" $(RUNTIME_ENV) $1 $(ARCH_EXECUTOR) $(TEST_RUNNER_CMD) $(TCYGTARGET) $(TEST_RUNNER_ARG_XML)$(TEST_REPORT_PATH) $(RUNARGS) $(patsubst %,+f %,$(T)) $(TARGS) 2>&1 | tee $(TTARGETDIR)/$(APPNAME)_$(MODNAME).stdout ) || true
231242
endef
232243
endif
233244

234-
define post-test
235-
@( [ -d test -a ! -r $(TEST_REPORT_PATH) ] && $(ABS_PRINT_error) "no test report, test runner exited abnormally." ) || true
236-
@( [ -d test -a -r $(TEST_REPORT_PATH) ] && xsltproc $(ABSROOT)/core/$(TXTXSL) $(TEST_REPORT_PATH) ) || true
237-
@if [ -d test ]; then [ -s $(TEST_REPORT_PATH) ]; else true; fi
238-
endef
239-
240245
define run-test
241246
$(pre-test)
242247
$(exec-test)
@@ -374,54 +379,7 @@ TESTNAME=$(word 2,$(MAKECMDGOALS))$(T)
374379

375380
.PHONY: newtest
376381
newtest:
377-
@$(ABS_PRINT_info) "Generating test class test/Test$(TESTNAME).cpp to test $(TESTNAME) class."
378-
@mkdir -p test
379-
@test -f test/Main.cpp || printf "#include <cppunit/plugin/TestPlugIn.h>\n#undef main\n\
380-
CPPUNIT_PLUGIN_IMPLEMENT();\n" > test/Main.cpp
381-
@test -f test/Test$(TESTNAME).cpp || printf "/*\n\
382-
* @file Test$(TESTNAME).cpp\n\
383-
*\n\
384-
* Copyright %d $(COMPANY). All rights reserved.\n\
385-
* Use is subject to license terms.\n\
386-
*\n\
387-
* \$$Id$$\n\
388-
* \$$Date$$\n\
389-
*/\n\
390-
#include \"abs/test.h\"\n\
391-
#include \"$(TINC_PATH)/$(TESTNAME).hpp\"\n\
392-
\n\
393-
namespace test {\n\
394-
using namespace $(TNAMESPACE);\n\
395-
\n\
396-
// ----------------------------------------------------------\n\
397-
// test suite implementation\n\
398-
ABS_TEST_SUITE_BEGIN( $(TESTNAME) )\n\
399-
// uncomment and complete next line for test suite description\n\
400-
// ABS_TEST_DESCR(test description)\n\
401-
\n\
402-
private:\n\
403-
\n\
404-
public:\n\
405-
void setUp() override {\n\
406-
}\n\
407-
\n\
408-
void tearDown() override {\n\
409-
}\n\
410-
\n\
411-
/* Test case template, uncomment and complete according this pattern for each test case\n\
412-
ABS_TEST_CASE_BEGIN(NameOfTestCase) {\n\
413-
ABS_TEST_DESCR(Test case description)\n\
414-
ABS_TEST_CASE_REQ(req.id) // one entry for each requirement checked by this case\n\
415-
// init/call service / function to be tested and collect results\n\
416-
\n\
417-
// check results with cppunit asserts\n\
418-
CPPUNIT_ASSERT( bool expr);\n\
419-
CPPUNIT_ASSERT_EQUAL(expected_value,computed_value);\n\
420-
}\n\
421-
ABS_TEST_CASE_END\n\
422-
*/\n\
423-
ABS_TEST_SUITE_END\n\
424-
} // namespace test\n" `date +%Y` > test/Test$(TESTNAME).cpp
382+
$(new_test_cmd)
425383

426384
$(TESTNAME):
427385
@:

core/xunit/cppunit.mk

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
##
2+
## CPPUNIT configuration variables
3+
##
4+
## - CPPUNIT: cppunit version. Default is set accorging your gcc version
5+
## - 1.14.0 for gcc >= 6.0
6+
## - 1.12.1 for gcc < 6.0
7+
ifeq ($(filter %-win32 %-posix,$(CC_VERSION)),)
8+
CC_VERSION_GE6:=$(shell [ `echo "$(CC_VERSION)" | cut -f1 -d.` -ge 6 ] && echo true || echo false)
9+
ifeq ($(CC_VERSION_GE6),false)
10+
CPPUNIT?=cppunit|1.12.1
11+
endif
12+
endif
13+
CPPUNIT?=cppunit|1.14.0
14+
15+
TESTRUNNER=ctrunner$(BINEXT)
16+
TXTXSL=xunit2txt.xsl
17+
# default TIMEOUT 10min
18+
TIMEOUT?=600
19+
ifeq ($(COLORS_TCAP),yes)
20+
TIMEOUTCMD:=
21+
else
22+
TIMEOUTCMD:=timeout $(TIMEOUT)
23+
endif
24+
25+
CPPUNIT_DIR=$(call GetExtLibDir,$(NDEXTLIBDIR),$(CPPUNIT))
26+
TCFLAGS+=-I$(CPPUNIT_DIR)/include
27+
TLDFLAGS+=-L$(CPPUNIT_DIR)/$(SODIR)
28+
TLINKLIB+=cppunit
29+
30+
define pre_compile_cpp_test
31+
# generation of header for cppunit tests definition. Remove one line defines to avoid resolving them now.
32+
@grep -v "#\s*include" $< | grep -v -E "#\s*define.*[^\]$$" | $(CPPC) -x c++ -E - |\
33+
grep -E "ABS_TEST_.*_BEGIN|ABS_TEST_SUITE_END" | sed -E 's/\{ *$$//g' |\
34+
$(CPPC) -x c++ -E -include $(ABSROOT)/core/include/abs/testdef2cppunitdecl.h - |\
35+
sed -e '/^#/d;s/!$$//g;s/ !!!/\n!!!/g;s/!!!/#/g' > $(patsubst %.o,%.h,$@)
36+
$(gen-json-test-cppc)
37+
endef
38+
39+
define pre_compile_c_test
40+
$(gen-json-test-cc)
41+
endef
42+
43+
define updateOptionsAndFlags
44+
$(eval $(1):= -shared -include $(patsubst %.o,%.h,$(4)) $(2) $(3))
45+
endef
46+
47+
ARE_TESTS_AVAILABLE:=$(wildcard test/Main.cpp)
48+
49+
define post-test
50+
@( [ -d test -a ! -r $(TEST_REPORT_PATH) ] && $(ABS_PRINT_error) "no test report, test runner exited abnormally." ) || true
51+
@( [ -d test -a -r $(TEST_REPORT_PATH) ] && xsltproc $(ABSROOT)/core/$(TXTXSL) $(TEST_REPORT_PATH) ) || true
52+
@if [ -d test ]; then [ -s $(TEST_REPORT_PATH) ]; else true; fi
53+
endef
54+
55+
56+
CPP_UNIT_TESTER_LIB:=$(CPPUNIT)
57+
58+
TEST_RUNNER_CMD:=$(CPPUNIT_DIR)/bin/$(TESTRUNNER)
59+
TEST_RUNNER_ARG_XML:=-x
60+
61+
define new_test_cmd
62+
@$(ABS_PRINT_info) "Generating test class test/Test$(TESTNAME).cpp to test $(TESTNAME) class."
63+
@mkdir -p test
64+
@test -f test/Main.cpp || printf "#include <cppunit/plugin/TestPlugIn.h>\n#undef main\n\
65+
CPPUNIT_PLUGIN_IMPLEMENT();\n" > test/Main.cpp
66+
@test -f test/Test$(TESTNAME).cpp || printf "/*\n\
67+
* @file Test$(TESTNAME).cpp\n\
68+
*\n\
69+
* Copyright %d $(COMPANY). All rights reserved.\n\
70+
* Use is subject to license terms.\n\
71+
*\n\
72+
* \$$Id$$\n\
73+
* \$$Date$$\n\
74+
*/\n\
75+
#include \"abs/test.h\"\n\
76+
#include \"$(TINC_PATH)/$(TESTNAME).hpp\"\n\
77+
\n\
78+
namespace test {\n\
79+
using namespace $(TNAMESPACE);\n\
80+
\n\
81+
// ----------------------------------------------------------\n\
82+
// test suite implementation\n\
83+
ABS_TEST_SUITE_BEGIN( $(TESTNAME) )\n\
84+
// uncomment and complete next line for test suite description\n\
85+
// ABS_TEST_DESCR(test description)\n\
86+
\n\
87+
private:\n\
88+
\n\
89+
public:\n\
90+
void setUp() {\n\
91+
}\n\
92+
\n\
93+
void tearDown() {\n\
94+
}\n\
95+
\n\
96+
/* Test case template, uncomment and complete according this pattern for each test case\n\
97+
ABS_TEST_CASE_BEGIN(NameOfTestCase) {\n\
98+
ABS_TEST_DESCR(Test case description)\n\
99+
ABS_TEST_CASE_REQ(req.id) // one entry for each requirement checked by this case\n\
100+
// init/call service / function to be tested and collect results\n\
101+
\n\
102+
// check results with cppunit asserts\n\
103+
CPPUNIT_ASSERT( bool expr);\n\
104+
CPPUNIT_ASSERT_EQUAL(expected_value,computed_value);\n\
105+
}\n\
106+
ABS_TEST_CASE_END\n\
107+
*/\n\
108+
ABS_TEST_SUITE_END\n\
109+
} // namespace test\n" `date +%Y` > test/Test$(TESTNAME).cpp
110+
111+
endef

0 commit comments

Comments
 (0)