2022-08-18 22:58:41 +02:00
|
|
|
Tests= \
|
|
|
|
context.o \
|
|
|
|
environment.o \
|
|
|
|
interpreter.o \
|
|
|
|
lex.o \
|
|
|
|
main.o \
|
|
|
|
number.o \
|
|
|
|
parser.o \
|
|
|
|
unicode.o \
|
|
|
|
value.o
|
|
|
|
|
|
|
|
Test_Obj=$(addprefix bin/debug/tests/,$(Tests))
|
|
|
|
|
|
|
|
test: unit-tests
|
2022-08-18 23:02:00 +02:00
|
|
|
scripts/test.py test examples
|
2022-08-18 22:58:41 +02:00
|
|
|
|
|
|
|
unit-tests: bin/unit-tests
|
|
|
|
./$<
|
|
|
|
|
|
|
|
bin/unit-tests: $(Test_Obj) $(Debug_Obj)
|
|
|
|
@echo "CXX $@"
|
|
|
|
@$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(DEBUG_FLAGS) -o $@ $^
|
|
|
|
|
|
|
|
unit-test-coverage:
|
|
|
|
@which gcov >/dev/null || ( echo "[ERROR] gcov is required for test coverage report"; false )
|
|
|
|
@which gcovr >/dev/null || ( echo "[ERROR] gcovr is required for test coverage report"; false )
|
|
|
|
CXXFLAGS=--coverage $(MAKE) bin/unit-tests -B
|
|
|
|
bin/unit-tests
|
|
|
|
rm -rf coverage
|
|
|
|
mkdir coverage
|
|
|
|
gcovr -e '.*\.hpp' -e 'src/tests/.*' -e 'src/pretty.cc' --html --html-details -o coverage/index.html
|
|
|
|
rm -rf bin/debug
|
|
|
|
xdg-open coverage/index.html
|