summaryrefslogtreecommitdiff
path: root/test/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile28
1 files changed, 21 insertions, 7 deletions
diff --git a/test/Makefile b/test/Makefile
index 64c3f39a4..82ffee6fa 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -7,6 +7,7 @@ TESTS := \
nsoption \
bloom \
hashtable \
+ hashmap \
urlescape \
utils \
messages \
@@ -18,17 +19,19 @@ TESTS := \
NSURL_SOURCES := utils/nsurl/nsurl.c utils/nsurl/parse.c utils/idna.c \
utils/punycode.c
-# nsurl sources
+# nsurl test sources
nsurl_SRCS := $(NSURL_SOURCES) utils/corestrings.c test/log.c test/nsurl.c
# url database test sources
urldbtest_SRCS := $(NSURL_SOURCES) \
utils/bloom.c utils/nsoption.c utils/corestrings.c utils/time.c \
utils/hashtable.c utils/messages.c utils/utils.c \
+ utils/http/primitives.c utils/http/generics.c \
+ utils/http/strict-transport-security.c \
content/urldb.c \
test/log.c test/urldbtest.c
-# low level cache sources
+# low level cache test sources
llcache_SRCS := content/fetch.c content/fetchers/curl.c \
content/fetchers/about.c content/fetchers/data.c \
content/fetchers/resource.c content/llcache.c \
@@ -50,6 +53,10 @@ bloom_SRCS := utils/bloom.c test/bloom.c
# hash table test sources
hashtable_SRCS := utils/hashtable.c test/log.c test/hashtable.c
+# hashmap test sources
+hashmap_SRCS := $(NSURL_SOURCES) utils/hashmap.c utils/corestrings.c test/log.c test/hashmap.c
+hashmap_LD := -lmalloc_fig
+
# url escape test sources
urlescape_SRCS := utils/url.c test/log.c test/urlescape.c
@@ -125,20 +132,25 @@ endef
$(eval $(call pkg_cfg_detect_lib,check,Check))
-COMMON_WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wcast-align \
+TEST_WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wmissing-declarations -Wuninitialized
ifneq ($(CC_MAJOR),2)
- COMMON_WARNFLAGS += -Wno-unused-parameter
+ TEST_WARNFLAGS += -Wno-unused-parameter
endif
BASE_TESTCFLAGS := -std=c99 -g \
- $(COMMON_WARNFLAGS) \
+ $(TEST_WARNFLAGS) \
-D_DEFAULT_SOURCE \
-D_POSIX_C_SOURCE=200809L \
-D_XOPEN_SOURCE=600 \
-Itest -Iinclude -Icontent/handlers -Ifrontends -I. -I.. \
-Dnsgtk \
+ -DNETSURF_BUILTIN_LOG_FILTER=\"level:WARNING\" \
+ -DNETSURF_BUILTIN_VERBOSE_FILTER=\"level:DEBUG\" \
+ -DTESTROOT=\"$(TESTROOT)\" \
+ -DWITH_UTF8PROC \
+ $(SAN_FLAGS) \
$(shell pkg-config --cflags libcurl libparserutils libwapcaplet libdom libnsutils libutf8proc) \
$(LIB_CFLAGS)
TESTCFLAGS := $(BASE_TESTCFLAGS) \
@@ -147,12 +159,13 @@ TESTCFLAGS := $(BASE_TESTCFLAGS) \
TESTLDFLAGS := -L$(TESTROOT) \
$(shell pkg-config --libs libcurl libparserutils libwapcaplet libdom libnsutils libutf8proc) -lz \
+ $(SAN_FLAGS) \
$(LIB_LDFLAGS)\
$(COV_LDFLAGS)
# malloc faliure injection generator
$(TESTROOT)/libmalloc_fig.so:test/malloc_fig.c
- $(CC) -shared -fPIC -I. -std=c99 $(COMMON_WARNFLAGS) $^ -o $@
+ $(CC) -shared -fPIC -I. -std=c99 $(TEST_WARNFLAGS) $^ -ldl -o $@
# Source files for all tests being compiled
TESTSOURCES :=
@@ -200,11 +213,12 @@ $(eval $(foreach SOURCE,$(sort $(filter %.c,$(NOCOV_TESTSOURCES))), \
$(call compile_test_nocov_target_c,$(SOURCE),$(subst /,_,$(SOURCE:.c=.o)),$(subst /,_,$(SOURCE:.c=.d)))))
-.PHONY:test coverage
+.PHONY:test coverage sanitize
test: $(TESTROOT)/created $(TESTROOT)/libmalloc_fig.so $(addsuffix _test,$(TESTS))
coverage: test
+sanitize: test
$(TESTROOT)/created:
$(VQ)echo " MKDIR: $(TESTROOT)"