diff options
author | van Hauser <vh@thc.org> | 2020-02-06 15:50:01 +0100 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-02-06 15:50:01 +0100 |
commit | b2191985765e58db4a3b7a2eb1e25f063733839a (patch) | |
tree | 85920c7dbed28f10a683b3cf541dd97a8133474b | |
parent | ff210e824b4e3b1fe60f9a0500b48732937786d2 (diff) | |
download | afl++-b2191985765e58db4a3b7a2eb1e25f063733839a.tar.gz |
made cmin testcase more complex and added cmin.bash
-rwxr-xr-x | test/test.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/test/test.sh b/test/test.sh index a2f2ab53..57b50eb4 100755 --- a/test/test.sh +++ b/test/test.sh @@ -149,12 +149,22 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" && { CODE=1 } echo 000000000000000000000000 > in/in2 + echo 111 > in/in3 mkdir -p in2 - ../afl-cmin -i in -o in2 -- ./test-instr.plain >/dev/null - CNT=`ls in2/ | wc -l` + ../afl-cmin -i in -o in2 -- ./test-instr.plain >/dev/null 2>&1 # why is afl-forkserver writing to stderr? + CNT=`ls in2/* 2>/dev/null | wc -l` case "$CNT" in - *1) $ECHO "$GREEN[+] afl-cmin correctly minimized the number of testcases" ;; - *) $ECHO "$RED[!] afl-cmin did not correctly minimize the number of testcases" + *2) $ECHO "$GREEN[+] afl-cmin correctly minimized the number of testcases" ;; + *) $ECHO "$RED[!] afl-cmin did not correctly minimize the number of testcases ($CNT)" + CODE=1 + ;; + esac + rm -f in2/in* + AFL_PATH=`pwd`/.. ../afl-cmin.bash -i in -o in2 -- ./test-instr.plain >/dev/null + CNT=`ls in2/* 2>/dev/null | wc -l` + case "$CNT" in + *2) $ECHO "$GREEN[+] afl-cmin.bash correctly minimized the number of testcases" ;; + *) $ECHO "$RED[!] afl-cmin.bash did not correctly minimize the number of testcases ($CNT)" CODE=1 ;; esac |