added some testcases

+ adapted makefile to delete coverage data from former runs
This commit is contained in:
prozessorkern
2019-12-05 22:55:28 +01:00
parent 5f96d86892
commit 11bf2d2671
4 changed files with 153 additions and 10 deletions

View File

@@ -17,7 +17,7 @@ SOURCES := src/shellmatta.c \
src/shellmatta_history.c \
src/shellmatta_utils.c \
src/shellmatta_escape.c
INCLUDES := api .
UNITTEST_SOURCES := test/unittest/test_main.cpp \
@@ -30,7 +30,8 @@ UNITTEST_SOURCES := test/unittest/test_main.cpp
test/unittest/shellmatta_utils/test_utils_forwardCursor.cpp \
test/unittest/shellmatta_utils/test_utils_clearInput.cpp \
test/unittest/shellmatta_utils/test_utils_insertChars.cpp \
test/unittest/shellmatta_autocomplete/test_autocomplete_run.cpp \
test/unittest/shellmatta_utils/test_utils_terminateInput.cpp \
test/unittest/shellmatta_autocomplete/test_autocomplete_run.cpp \
test/unittest/shellmatta_escape/test_escape_processArrowKeys.cpp \
test/unittest/shellmatta_history/test_appendHistoryByte.cpp \
test/unittest/shellmatta/test_shellmatta_doInit.cpp
@@ -47,7 +48,7 @@ TESTFLAGS := $(INCLUDES:%=-I%) -g -Wall -Werror -fprofile-arcs -ftest-coverage
TESTLFLAGS := -fprofile-arcs -Wl,--allow-multiple-definition
DEPEND = -MT $@ -MF "$(@:%.o=%.d)" -MG -MM
COBJ := $(patsubst %.c,$(OBJ_DIR)%.o,$(SOURCES))
EXAMPLE_SOURCES := example/main.c
@@ -82,10 +83,15 @@ cppcheck:
unittest: $(UNITTEST_TARGET)
- @mkdir -p output/test/unittest/report
@echo running test:
@# remove coverage from former run
@-find . -name "*.gcda" -type f -delete
-$(UNITTEST_TARGET)
#gcov -o output/test $(TEST_CPPOBJ) -r
@#gcov -o output/test/unittest $(UNITTEST_CPPOBJ) -r src
@# remove report from former run
-rm -rf $(OBJ_DIR)test/unittest/report/*
gcovr --html-details --output $(OBJ_DIR)test/unittest/report/report.html output/test/unittest -f src -f api
#-rm *.gcov
@#-rm *.gcov
integrationtest: $(INTEGRATIONTEST_TARGET)
- @mkdir -p output/test/integrationtest/report