mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 17:54:33 +03:00
make options test use build directory for temporary files rather than /tmp
This commit is contained in:
parent
737a09d53e
commit
40aa44e4f5
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user