summaryrefslogtreecommitdiff
path: root/test/nsoption.c
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/nsoption.c
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/nsoption.c')
-rw-r--r--test/nsoption.c6
1 files changed, 5 insertions, 1 deletions
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;
}