diff options
author | Daniel Dunbar <daniel@zuster.org> | 2014-09-12 17:03:35 -0700 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2014-09-12 17:39:18 -0700 |
commit | 9b715dfc40311247b08daf5fa8695a95fd66106f (patch) | |
tree | e45588fba94a530653d8b6bcddafc5cda3e2adef /test/Runtime/POSIX | |
parent | 9a3cf72b8979213bcc6d235856bb0ddba4ee37c8 (diff) | |
download | klee-9b715dfc40311247b08daf5fa8695a95fd66106f.tar.gz |
[tests] Set --output-dir on all test runs, in support of running tests in parallel.
- It would be nice if there was an easier way to do this that didn't involve editing all of the tests (like running each test in its own directory), but this approach fixes #146 and doesn't involve changing 'lit' or writing a wrapper harness. My assumption is a lot of tests start are derived from another one, so hopefully following this convention won't be burdensome, and I updated 'make check' so that it will produce an error if any test runs klee without --output-dir (by checking for the existing of klee-last files). - This also helps with #147 but I still can't fully run tests in parallel (I start hitting STP errors).
Diffstat (limited to 'test/Runtime/POSIX')
-rw-r--r-- | test/Runtime/POSIX/DirConsistency.c | 6 | ||||
-rw-r--r-- | test/Runtime/POSIX/DirSeek.c | 9 | ||||
-rw-r--r-- | test/Runtime/POSIX/FDNumbers.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/FD_Fail.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/FD_Fail2.c | 17 | ||||
-rw-r--r-- | test/Runtime/POSIX/Fcntl.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/FilePerm.c | 9 | ||||
-rw-r--r-- | test/Runtime/POSIX/FreeArgv.c | 9 | ||||
-rw-r--r-- | test/Runtime/POSIX/Futimesat.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/Getenv.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/Ioctl.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/Isatty.c | 11 | ||||
-rw-r--r-- | test/Runtime/POSIX/Openat.c | 5 | ||||
-rw-r--r-- | test/Runtime/POSIX/PrgName.c | 7 | ||||
-rw-r--r-- | test/Runtime/POSIX/Read1.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/SELinux/SELinux.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/SeedAndFail.c | 9 | ||||
-rw-r--r-- | test/Runtime/POSIX/Stdin.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/Write1.c | 3 | ||||
-rw-r--r-- | test/Runtime/POSIX/Write2.c | 3 |
20 files changed, 69 insertions, 46 deletions
diff --git a/test/Runtime/POSIX/DirConsistency.c b/test/Runtime/POSIX/DirConsistency.c index 24bb8a6e..879dd75f 100644 --- a/test/Runtime/POSIX/DirConsistency.c +++ b/test/Runtime/POSIX/DirConsistency.c @@ -1,7 +1,9 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --run-in=/tmp --search=random-state --libc=uclibc --posix-runtime --exit-on-error %t.bc --sym-files 1 1 > %t1.log +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --run-in=/tmp --search=random-state --libc=uclibc --posix-runtime --exit-on-error %t.bc --sym-files 1 1 > %t1.log // RUN: %llvmgcc -D_FILE_OFFSET_BITS=64 %s -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --run-in=/tmp --search=random-state --libc=uclibc --posix-runtime --exit-on-error %t.bc --sym-files 1 1 > %t2.log +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --run-in=/tmp --search=random-state --libc=uclibc --posix-runtime --exit-on-error %t.bc --sym-files 1 1 > %t2.log // RUN: sort %t1.log %t2.log | uniq -c > %t3.log // RUN: grep -q "4 COUNT" %t3.log diff --git a/test/Runtime/POSIX/DirSeek.c b/test/Runtime/POSIX/DirSeek.c index 81336a68..1b2c25e8 100644 --- a/test/Runtime/POSIX/DirSeek.c +++ b/test/Runtime/POSIX/DirSeek.c @@ -1,7 +1,10 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t2.bc -// RUN: %klee --run-in=/tmp --libc=uclibc --posix-runtime --exit-on-error %t2.bc --sym-files 2 2 -// RUN: %klee --run-in=/tmp --libc=uclibc --posix-runtime --exit-on-error %t2.bc --sym-files 1 2 -// RUN: %klee --run-in=/tmp --libc=uclibc --posix-runtime --exit-on-error %t2.bc --sym-files 0 2 +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --run-in=/tmp --libc=uclibc --posix-runtime --exit-on-error %t2.bc --sym-files 2 2 +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --run-in=/tmp --libc=uclibc --posix-runtime --exit-on-error %t2.bc --sym-files 1 2 +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --run-in=/tmp --libc=uclibc --posix-runtime --exit-on-error %t2.bc --sym-files 0 2 // For this test really to work as intended it needs to be run in a // directory large enough to cause uclibc to do multiple getdents diff --git a/test/Runtime/POSIX/FDNumbers.c b/test/Runtime/POSIX/FDNumbers.c index 3228c8a9..c012174c 100644 --- a/test/Runtime/POSIX/FDNumbers.c +++ b/test/Runtime/POSIX/FDNumbers.c @@ -1,5 +1,6 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t2.bc -// RUN: %klee --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 #include <assert.h> #include <fcntl.h> diff --git a/test/Runtime/POSIX/FD_Fail.c b/test/Runtime/POSIX/FD_Fail.c index a4bf2fc2..186ada51 100644 --- a/test/Runtime/POSIX/FD_Fail.c +++ b/test/Runtime/POSIX/FD_Fail.c @@ -1,5 +1,6 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc -// RUN: %klee --libc=uclibc --posix-runtime %t1.bc --sym-files 0 0 --max-fail 1 > %t.log +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --libc=uclibc --posix-runtime %t1.bc --sym-files 0 0 --max-fail 1 > %t.log // RUN: grep -q "fread(): ok" %t.log // RUN: grep -q "fread(): fail" %t.log // RUN: grep -q "fclose(): ok" %t.log diff --git a/test/Runtime/POSIX/FD_Fail2.c b/test/Runtime/POSIX/FD_Fail2.c index 624329fc..74957597 100644 --- a/test/Runtime/POSIX/FD_Fail2.c +++ b/test/Runtime/POSIX/FD_Fail2.c @@ -1,12 +1,13 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc -// RUN: %klee --libc=uclibc --posix-runtime --search=dfs %t1.bc --sym-files 1 10 --max-fail 1 -// RUN: test -f %T/klee-last/test000001.ktest -// RUN: test -f %T/klee-last/test000002.ktest -// RUN: test -f %T/klee-last/test000003.ktest -// RUN: test -f %T/klee-last/test000004.ktest -// RUN: test -f %T/klee-last/test000005.ktest -// RUN: test -f %T/klee-last/test000006.ktest -// RUN: test -f %T/klee-last/test000007.ktest +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --libc=uclibc --posix-runtime --search=dfs %t1.bc --sym-files 1 10 --max-fail 1 +// RUN: test -f %t.klee-out/test000001.ktest +// RUN: test -f %t.klee-out/test000002.ktest +// RUN: test -f %t.klee-out/test000003.ktest +// RUN: test -f %t.klee-out/test000004.ktest +// RUN: test -f %t.klee-out/test000005.ktest +// RUN: test -f %t.klee-out/test000006.ktest +// RUN: test -f %t.klee-out/test000007.ktest #include <stdio.h> #include <assert.h> diff --git a/test/Runtime/POSIX/Fcntl.c b/test/Runtime/POSIX/Fcntl.c index 1b37e711..13f6de78 100644 --- a/test/Runtime/POSIX/Fcntl.c +++ b/test/Runtime/POSIX/Fcntl.c @@ -1,5 +1,6 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t2.bc -// RUN: %klee --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 #include <assert.h> #include <fcntl.h> diff --git a/test/Runtime/POSIX/FilePerm.c b/test/Runtime/POSIX/FilePerm.c index 1346c09a..c66e35de 100644 --- a/test/Runtime/POSIX/FilePerm.c +++ b/test/Runtime/POSIX/FilePerm.c @@ -1,8 +1,9 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --posix-runtime %t.bc --sym-files 1 10 --sym-stdout 2>%t.log -// RUN: test -f %T/klee-last/test000001.ktest -// RUN: test -f %T/klee-last/test000002.ktest -// RUN: test -f %T/klee-last/test000003.ktest +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --posix-runtime %t.bc --sym-files 1 10 --sym-stdout 2>%t.log +// RUN: test -f %t.klee-out/test000001.ktest +// RUN: test -f %t.klee-out/test000002.ktest +// RUN: test -f %t.klee-out/test000003.ktest #include <stdio.h> #include <sys/types.h> diff --git a/test/Runtime/POSIX/FreeArgv.c b/test/Runtime/POSIX/FreeArgv.c index 4d2e5b75..8f812b5d 100644 --- a/test/Runtime/POSIX/FreeArgv.c +++ b/test/Runtime/POSIX/FreeArgv.c @@ -1,8 +1,9 @@ // RUN: %llvmgcc %s -g -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --posix-runtime %t.bc --sym-args 1 1 1 2>&1 | FileCheck %s -// RUN: test -f %T/klee-last/test000001.free.err -// RUN: test -f %T/klee-last/test000002.free.err -// RUN: test -f %T/klee-last/test000003.free.err +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --posix-runtime %t.bc --sym-args 1 1 1 2>&1 | FileCheck %s +// RUN: test -f %t.klee-out/test000001.free.err +// RUN: test -f %t.klee-out/test000002.free.err +// RUN: test -f %t.klee-out/test000003.free.err int main(int argc, char **argv) { // FIXME: Use FileCheck's CHECK-DAG to check source locations diff --git a/test/Runtime/POSIX/Futimesat.c b/test/Runtime/POSIX/Futimesat.c index 6ae0ca7c..011fe56f 100644 --- a/test/Runtime/POSIX/Futimesat.c +++ b/test/Runtime/POSIX/Futimesat.c @@ -1,6 +1,7 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -g -c -o %t2.bc // RUN: touch /tmp/futimesat-dummy -// RUN: %klee --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 +// 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 <assert.h> diff --git a/test/Runtime/POSIX/Getenv.c b/test/Runtime/POSIX/Getenv.c index 9d5672f7..eb3a611a 100644 --- a/test/Runtime/POSIX/Getenv.c +++ b/test/Runtime/POSIX/Getenv.c @@ -1,5 +1,6 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t2.bc -// RUN: %klee --libc=klee --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --libc=klee --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 #include <assert.h> diff --git a/test/Runtime/POSIX/Ioctl.c b/test/Runtime/POSIX/Ioctl.c index 93ce4b5c..e8220276 100644 --- a/test/Runtime/POSIX/Ioctl.c +++ b/test/Runtime/POSIX/Ioctl.c @@ -1,5 +1,6 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --posix-runtime --exit-on-error %t.bc --sym-files 0 4 +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --posix-runtime --exit-on-error %t.bc --sym-files 0 4 #include <assert.h> #include <fcntl.h> diff --git a/test/Runtime/POSIX/Isatty.c b/test/Runtime/POSIX/Isatty.c index 3054aadb..241c5cbb 100644 --- a/test/Runtime/POSIX/Isatty.c +++ b/test/Runtime/POSIX/Isatty.c @@ -1,9 +1,10 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --libc=uclibc --posix-runtime %t.bc --sym-files 0 10 --sym-stdout > %t.log 2>&1 -// RUN: test -f %T/klee-last/test000001.ktest -// RUN: test -f %T/klee-last/test000002.ktest -// RUN: test -f %T/klee-last/test000003.ktest -// RUN: test -f %T/klee-last/test000004.ktest +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --libc=uclibc --posix-runtime %t.bc --sym-files 0 10 --sym-stdout > %t.log 2>&1 +// RUN: test -f %t.klee-out/test000001.ktest +// RUN: test -f %t.klee-out/test000002.ktest +// RUN: test -f %t.klee-out/test000003.ktest +// RUN: test -f %t.klee-out/test000004.ktest // RUN: grep -q "stdin is a tty" %t.log // RUN: grep -q "stdin is NOT a tty" %t.log // RUN: grep -q "stdout is a tty" %t.log diff --git a/test/Runtime/POSIX/Openat.c b/test/Runtime/POSIX/Openat.c index 3c17f976..c46c1269 100644 --- a/test/Runtime/POSIX/Openat.c +++ b/test/Runtime/POSIX/Openat.c @@ -1,6 +1,7 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t2.bc -// RUN: %klee --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 -// RUN: test -f %T/klee-last/test000001.ktest +// 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: test -f %t.klee-out/test000001.ktest #include <assert.h> #include <fcntl.h> diff --git a/test/Runtime/POSIX/PrgName.c b/test/Runtime/POSIX/PrgName.c index 6bc682ca..d62fe0fa 100644 --- a/test/Runtime/POSIX/PrgName.c +++ b/test/Runtime/POSIX/PrgName.c @@ -1,7 +1,8 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t2.bc -// RUN: %klee --posix-runtime --exit-on-error %t2.bc --sym-arg 10 >%t.log -// RUN: test -f %T/klee-last/test000001.ktest -// RUN: test -f %T/klee-last/test000002.ktest +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --posix-runtime --exit-on-error %t2.bc --sym-arg 10 >%t.log +// RUN: test -f %t.klee-out/test000001.ktest +// RUN: test -f %t.klee-out/test000002.ktest // RUN: grep -q "No" %t.log // RUN: grep -qv "Yes" %t.log diff --git a/test/Runtime/POSIX/Read1.c b/test/Runtime/POSIX/Read1.c index 66831073..2b8cfa9d 100644 --- a/test/Runtime/POSIX/Read1.c +++ b/test/Runtime/POSIX/Read1.c @@ -1,5 +1,6 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --exit-on-error --posix-runtime %t.bc --sym-files 1 8 >%t.log +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --exit-on-error --posix-runtime %t.bc --sym-files 1 8 >%t.log #include <unistd.h> #include <sys/types.h> diff --git a/test/Runtime/POSIX/SELinux/SELinux.c b/test/Runtime/POSIX/SELinux/SELinux.c index 65dd1a7f..21bebc4d 100644 --- a/test/Runtime/POSIX/SELinux/SELinux.c +++ b/test/Runtime/POSIX/SELinux/SELinux.c @@ -1,6 +1,7 @@ /* Very basic test, as right now SELinux support is extremely basic */ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc -// RUN: %klee --posix-runtime --exit-on-error %t1.bc --sym-arg 2 > %t.log +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --posix-runtime --exit-on-error %t1.bc --sym-arg 2 > %t.log // XFAIL: no-selinux #include <selinux/selinux.h> diff --git a/test/Runtime/POSIX/SeedAndFail.c b/test/Runtime/POSIX/SeedAndFail.c index d9bd7f8d..964ec500 100644 --- a/test/Runtime/POSIX/SeedAndFail.c +++ b/test/Runtime/POSIX/SeedAndFail.c @@ -1,8 +1,9 @@ // RUN: %llvmgcc %s -emit-llvm -g -O0 -c -o %t.bc -// RUN: rm -rf %T/tmp-123 -// RUN: %klee --libc=uclibc --output-dir=%T/tmp-123 --posix-runtime %t.bc --sym-files 1 10 2>%t.log -// RUN: %klee --seed-out-dir=%T/tmp-123 --zero-seed-extension --libc=uclibc --posix-runtime %t.bc --sym-files 1 10 --max-fail 1 -// RUN: ls %T/klee-last | grep -c assert | grep 4 +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --libc=uclibc --posix-runtime %t.bc --sym-files 1 10 2>%t.log +// RUN: rm -rf %t.klee-out-2 +// RUN: %klee --output-dir=%t.klee-out-2 --seed-out-dir=%t.klee-out --zero-seed-extension --libc=uclibc --posix-runtime %t.bc --sym-files 1 10 --max-fail 1 +// RUN: ls %t.klee-out-2 | grep -c assert | grep 4 #include <string.h> #include <assert.h> diff --git a/test/Runtime/POSIX/Stdin.c b/test/Runtime/POSIX/Stdin.c index b5402cf1..ebf16405 100644 --- a/test/Runtime/POSIX/Stdin.c +++ b/test/Runtime/POSIX/Stdin.c @@ -1,5 +1,6 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --libc=uclibc --posix-runtime --exit-on-error %t.bc --sym-files 0 4 > %t.log +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --libc=uclibc --posix-runtime --exit-on-error %t.bc --sym-files 0 4 > %t.log // RUN: grep "mode:file" %t.log // RUN: grep "mode:dir" %t.log // RUN: grep "mode:chr" %t.log diff --git a/test/Runtime/POSIX/Write1.c b/test/Runtime/POSIX/Write1.c index 16132b82..d260f2c3 100644 --- a/test/Runtime/POSIX/Write1.c +++ b/test/Runtime/POSIX/Write1.c @@ -1,5 +1,6 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --exit-on-error --libc=uclibc --posix-runtime %t.bc --sym-files 1 10 --sym-stdout 2>%t.log +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --exit-on-error --libc=uclibc --posix-runtime %t.bc --sym-files 1 10 --sym-stdout 2>%t.log #include <stdio.h> #include <assert.h> diff --git a/test/Runtime/POSIX/Write2.c b/test/Runtime/POSIX/Write2.c index 9801e70c..edb3e5b2 100644 --- a/test/Runtime/POSIX/Write2.c +++ b/test/Runtime/POSIX/Write2.c @@ -1,5 +1,6 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc -// RUN: %klee --exit-on-error --libc=uclibc --posix-runtime %t.bc --sym-files 1 10 --sym-stdout 2>%t.log +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --exit-on-error --libc=uclibc --posix-runtime %t.bc --sym-files 1 10 --sym-stdout 2>%t.log #include <stdio.h> #include <assert.h> |