about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2019-10-12 01:49:23 +0200
committerhexcoder- <heiko@hexco.de>2019-10-12 01:49:23 +0200
commit132ecc0580e35a629ce7b6c0d9441ac63262318d (patch)
tree8319fa672b286e3e01d67f8b8900e48537fe349e
parent5157a56803ac1350748ba1c76521df3272616613 (diff)
downloadafl++-132ecc0580e35a629ce7b6c0d9441ac63262318d.tar.gz
catch afl-fuzz's output and print it in case of errors
-rwxr-xr-xtest/test.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/test/test.sh b/test/test.sh
index 0c5c18f7..a7376d16 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -97,12 +97,15 @@ test -e ../${AFL_GCC} -a -e ../afl-showmap -a -e ../afl-fuzz && {
     echo 0 > in/in
     $ECHO "$GREY[*] running afl-fuzz for ${AFL_GCC}, this will take approx 10 seconds"
     {
-      ../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain > /dev/null 2>&1
-    } > /dev/null 2>&1
+      ../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain >>errors 2>&1
+    } >>errors 2>&1
     test -n "$( ls out/queue/id:000002* 2> /dev/null )" && {
       $ECHO "$GREEN[+] afl-fuzz is working correctly with ${AFL_GCC}"
-    } || $ECHO "$RED[!] afl-fuzz is not working correctly with ${AFL_GCC}"
-    rm -rf in out
+    } || {
+      cat errors
+      $ECHO "$RED[!] afl-fuzz is not working correctly with ${AFL_GCC}"
+    }
+    rm -rf in out errors
   }
   rm -f test-instr.plain
 } || $ECHO "$YELLOW[-] afl is not compiled, cannot test"
@@ -144,12 +147,15 @@ test -e ../afl-clang-fast && {
     echo 0 > in/in
     $ECHO "$GREY[*] running afl-fuzz for llvm_mode, this will take approx 10 seconds"
     {
-      ../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain > /dev/null 2>&1
-    } > /dev/null 2>&1
+      ../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain >>errors 2>&1
+    } >>errors 2>&1
     test -n "$( ls out/queue/id:000002* 2> /dev/null )" && {
       $ECHO "$GREEN[+] afl-fuzz is working correctly with llvm_mode"
-    } || $ECHO "$RED[!] afl-fuzz is not working correctly with llvm_mode"
-    rm -rf in out
+    } || {
+      cat errors
+      $ECHO "$RED[!] afl-fuzz is not working correctly with llvm_mode"
+    }
+    rm -rf in out errors
   }
   rm -f test-instr.plain