From 781123a9061c6f89f8b2964a1f8d9c80c7ff605d Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Thu, 9 Jan 2020 09:50:51 +0100 Subject: NetBSDs wc -l prints spaces before the number, so string test failed -> use pattern matching with "case" instead. --- test/test.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/test.sh b/test/test.sh index 51b53de4..9e3c882e 100755 --- a/test/test.sh +++ b/test/test.sh @@ -152,11 +152,12 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" && { mkdir -p in2 ../afl-cmin -i in -o in2 -- ./test-instr.plain > /dev/null 2>&1 CNT=`ls in2/ | wc -l` - test "$CNT" = 1 && $ECHO "$GREEN[+] afl-cmin correctly minimized testcase numbers" - test "$CNT" = 1 || { - $ECHO "$RED[!] afl-cmin did not correctly minimize testcase numbers" + case "$CNT" in +1| *1) $ECHO "$GREEN[+] afl-cmin correctly minimized testcase numbers" ;; +*) $ECHO "$RED[!] afl-cmin did not correctly minimize testcase numbers" CODE=1 - } + ;; + esac ../afl-tmin -m200 -i in/in2 -o in2/in2 -- ./test-instr.plain > /dev/null 2>&1 SIZE=`ls -l in2/in2 2> /dev/null | awk '{print$5}'` test "$SIZE" = 1 && $ECHO "$GREEN[+] afl-tmin correctly minimized the testcase" -- cgit 1.4.1