From 094e356340d523f09697a76e42e65cc951828253 Mon Sep 17 00:00:00 2001 From: Andrew Chi Date: Thu, 24 Sep 2015 15:14:28 -0400 Subject: Don't use /tmp for futimesat unit test This causes problems on a shared machine where multiple users are running the KLEE unit tests. --- test/Runtime/POSIX/Futimesat.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/Runtime/POSIX/Futimesat.c b/test/Runtime/POSIX/Futimesat.c index 011fe56f..a6d9dc04 100644 --- a/test/Runtime/POSIX/Futimesat.c +++ b/test/Runtime/POSIX/Futimesat.c @@ -1,8 +1,7 @@ -// RUN: %llvmgcc %s -emit-llvm -O0 -g -c -o %t2.bc -// RUN: touch /tmp/futimesat-dummy +// RUN: %llvmgcc %s -emit-llvm -O0 -g -c -DTDIR=%T -o %t2.bc +// RUN: touch %T/futimesat-dummy // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 -// RUN: rm /tmp/futimesat-dummy #include #include @@ -11,6 +10,9 @@ #include #include +#define xstr(s) str(s) +#define str(s) #s + int main(int argc, char **argv) { int r; struct stat buf; @@ -29,8 +31,8 @@ int main(int argc, char **argv) { assert(buf.st_atime == times[0].tv_sec && buf.st_mtime == times[1].tv_sec); - /* assumes /tmp exists and is writeable */ - int fd = open("/tmp", O_RDONLY); + /* assumes TDIR exists and is writeable */ + int fd = open( xstr(TDIR) , O_RDONLY); assert(fd > 0); r = futimesat(fd, "futimesat-dummy", times); assert(r != -1); -- cgit 1.4.1