diff options
-rw-r--r-- | test/Makefile | 1 | ||||
-rw-r--r-- | test/nsoption.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/test/Makefile b/test/Makefile index e92ece75d..81482f6d1 100644 --- a/test/Makefile +++ b/test/Makefile @@ -143,6 +143,7 @@ BASE_TESTCFLAGS := -std=c99 -g \ -Dnsgtk \ -DNETSURF_BUILTIN_LOG_FILTER=\"level:WARNING\" \ -DNETSURF_BUILTIN_VERBOSE_FILTER=\"level:DEBUG\" \ + -DTESTROOT=\"$(TESTROOT)\" \ $(SAN_FLAGS) \ $(shell pkg-config --cflags libcurl libparserutils libwapcaplet libdom libnsutils libutf8proc) \ $(LIB_CFLAGS) diff --git a/test/nsoption.c b/test/nsoption.c index fe986790f..0159148f8 100644 --- a/test/nsoption.c +++ b/test/nsoption.c @@ -33,6 +33,10 @@ #include "utils/log.h" #include "utils/nsoption.h" +#ifndef TESTROOT +#define TESTROOT "/tmp" +#endif + const char *test_choices_path = "test/data/Choices"; const char *test_choices_short_path = "test/data/Choices-short"; const char *test_choices_all_path = "test/data/Choices-all"; @@ -51,7 +55,7 @@ static char *testnam(char *out) static char name[64]; int pid; pid=getpid(); - snprintf(name, 64, "/tmp/nsoptiontest%d%d", pid, count); + snprintf(name, 64, TESTROOT"/nsoptiontest%d%d", pid, count); count++; return name; } |