about summary refs log tree commit diff homepage
path: root/test/Runtime
diff options
context:
space:
mode:
authorFrank Busse <bb0xfb@gmail.com>2019-07-31 14:37:37 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2019-08-01 16:53:44 +0100
commit04f5031ce572fa7488c9d97155207a3f5832e212 (patch)
tree59513df3660a22c380f0e68fd132ba2cda069efc /test/Runtime
parenta243341556a81122bf45cc086a6a94b8b0d69bea (diff)
downloadklee-04f5031ce572fa7488c9d97155207a3f5832e212.tar.gz
tests: fix Gen(Random)Bout.c: cd - command not found
Diffstat (limited to 'test/Runtime')
-rw-r--r--test/Runtime/POSIX/GenBout.c18
-rw-r--r--test/Runtime/POSIX/GenRandomBout.c12
2 files changed, 17 insertions, 13 deletions
diff --git a/test/Runtime/POSIX/GenBout.c b/test/Runtime/POSIX/GenBout.c
index 1aac748c..ab09f39b 100644
--- a/test/Runtime/POSIX/GenBout.c
+++ b/test/Runtime/POSIX/GenBout.c
@@ -1,12 +1,16 @@
 // -- Core testing commands
 // RUN: rm -rf %t.out
-// RUN: mkdir -p %t.out && cd %t.out
-// RUN: echo -n aaaa > %t.aaaa.txt
-// RUN: echo -n bbbb > %t.bbbb.txt
-// RUN: echo -n cccc > %t.cccc.txt
-// RUN: %gen-bout -o -p -q file1 --sym-stdin %t.aaaa.txt --sym-file %t.bbbb.txt --sym-stdout %t.cccc.txt
+// RUN: rm -f %t.bout
+// RUN: mkdir -p %t.out
+// RUN: echo -n aaaa > %t.out/aaaa.txt
+// RUN: echo -n bbbb > %t.out/bbbb.txt
+// RUN: echo -n cccc > %t.out/cccc.txt
+// RUN: %gen-bout -o -p -q file1 --bout-file %t.bout --sym-stdin %t.out/aaaa.txt --sym-file %t.out/bbbb.txt --sym-stdout %t.out/cccc.txt
 // RUN: %cc %s -O0 -o %t
-// RUN: %klee-replay %t file.bout 2>&1 | grep "klee-replay: EXIT STATUS: NORMAL"
+// RUN: %klee-replay %t %t.bout 2> %t.out/out.txt
+// RUN: FileCheck --input-file=%t.out/out.txt %s
+
+// CHECK: klee-replay: EXIT STATUS: NORMAL
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -41,8 +45,6 @@ int check_file(const char *file_name, const int file_size) {
 }
 
 int main(int argc, char **argv) {
-  int i = 0;
-
   if (argc != 5)
     return 1;
 
diff --git a/test/Runtime/POSIX/GenRandomBout.c b/test/Runtime/POSIX/GenRandomBout.c
index 8f1199cb..e441df3d 100644
--- a/test/Runtime/POSIX/GenRandomBout.c
+++ b/test/Runtime/POSIX/GenRandomBout.c
@@ -1,9 +1,9 @@
 // -- Core testing commands
-// RUN: rm -rf %t.out
-// RUN: mkdir -p %t.out && cd %t.out
-// RUN: %gen-random-bout 100 -sym-arg 4 -sym-files 2 20 -sym-arg 5 -sym-stdin 8 -sym-stdout -sym-arg 6 -sym-args 1 4 5
+// RUN: rm -f %t.bout
+// RUN: %gen-random-bout 100 -sym-arg 4 -sym-files 2 20 -sym-arg 5 -sym-stdin 8 -sym-stdout -sym-arg 6 -sym-args 1 4 5 -bout-file %t.bout
 // RUN: %cc %s -O0 -o %t
-// RUN: %klee-replay %t file.bout 2>&1 | grep "klee-replay: EXIT STATUS: NORMAL"
+// RUN: %klee-replay %t %t.bout 2> %t.out
+// RUN: FileCheck --input-file=%t.out %s
 //
 // -- Option error handling tests
 // RUN: bash -c '%gen-random-bout || :' 2>&1 | grep "Usage"
@@ -11,6 +11,8 @@
 // RUN: bash -c '%gen-random-bout 100 --sym-args 5 3 || :' 2>&1 | grep "ran out of"
 // RUN: bash -c '%gen-random-bout 100 --sym-args 5 3 10 || :' 2>&1 | grep "should be no more"
 
+// CHECK: klee-replay: EXIT STATUS: NORMAL
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -75,7 +77,7 @@ int main(int argc, char **argv) {
   if (check_fd(1, 1024) < 0)
     return 1;
 
-  printf("All size tests passed\n");
+  puts("All size tests passed");
 
   return 0;
 }