summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2019-09-21 13:25:45 +0100
committerVincent Sanders <vince@kyllikki.org>2019-09-21 13:25:45 +0100
commit40aa44e4f50dd35cbc11332b1c1865b3152afb2d (patch)
treed0fd1225586696d811aa5137c99b908323693e06 /test
parent737a09d53e57b6ca7bba82e4e579056127fec17f (diff)
downloadnetsurf-40aa44e4f50dd35cbc11332b1c1865b3152afb2d.tar.gz
netsurf-40aa44e4f50dd35cbc11332b1c1865b3152afb2d.tar.bz2
make options test use build directory for temporary files rather than /tmp
Diffstat (limited to 'test')
-rw-r--r--test/Makefile1
-rw-r--r--test/nsoption.c6
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;
}