diff --git a/.travis.yml b/.travis.yml index 4cf6e64..de3d0ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ matrix: include: - compiler: gcc after_success: - - coveralls --exclude 'test' + - coveralls - compiler: clang after_success: - - coveralls --exclude 'test' --gcov llvm-cov --gcov-options gcov + - coveralls --gcov llvm-cov --gcov-options gcov diff --git a/Makefile b/Makefile index 69deeca..8b9a919 100644 --- a/Makefile +++ b/Makefile @@ -96,8 +96,11 @@ test-coverage-report: test-coverage --html-details \ -o docs/internal/coverage/index.html +test/%.o: test/%.c src/%.c + ${CC} -o $@ -c $< ${CFLAGS} + test/test: ${OBJ} ${TEST_OBJ} - ${CC} -o ${@} ${TEST_OBJ} ${OBJ} ${CFLAGS} ${LDFLAGS} + ${CC} -o ${@} ${TEST_OBJ} $(filter-out ${TEST_OBJ:test/%=src/%},${OBJ}) ${CFLAGS} ${LDFLAGS} .PHONY: doc doc-doxygen doc: docs/dunst.1 diff --git a/test/icon.c b/test/icon.c index 180a324..616bef6 100644 --- a/test/icon.c +++ b/test/icon.c @@ -1,9 +1,5 @@ +#include "../src/icon.c" #include "greatest.h" -#include "../src/icon.h" -#include "../src/utils.h" - -#include -#include #define ICONPREFIX "/data/icons/path" diff --git a/test/markup.c b/test/markup.c index b00888d..c4afa8d 100644 --- a/test/markup.c +++ b/test/markup.c @@ -1,10 +1,6 @@ +#include "src/markup.c" #include "greatest.h" -#include -#include - -#include "src/markup.h" - TEST test_markup_strip(void) { char *ptr; diff --git a/test/notification.c b/test/notification.c index b6afe2f..893d279 100644 --- a/test/notification.c +++ b/test/notification.c @@ -1,10 +1,9 @@ +#include "src/notification.c" #include "greatest.h" -#include "src/notification.h" + #include "src/option_parser.h" #include "src/settings.h" -#include - TEST test_notification_is_duplicate_field(char **field, struct notification *a, struct notification *b) diff --git a/test/option_parser.c b/test/option_parser.c index 3b942d8..bb44954 100644 --- a/test/option_parser.c +++ b/test/option_parser.c @@ -1,10 +1,6 @@ +#include "src/option_parser.c" #include "greatest.h" -#include -#include - -#include "src/option_parser.h" - TEST test_next_section(void) { const char *section = NULL; diff --git a/test/utils.c b/test/utils.c index 91e99fb..04cd223 100644 --- a/test/utils.c +++ b/test/utils.c @@ -1,7 +1,5 @@ +#include "src/utils.c" #include "greatest.h" -#include "src/utils.h" - -#include TEST test_string_replace_char(void) {