diff options
author | hexcoder- <heiko@hexco.de> | 2019-09-26 00:25:35 +0200 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2019-09-26 00:25:35 +0200 |
commit | a609b08c0ad1c3e9825604b3b97b634ac9bf344c (patch) | |
tree | 9583c281d4e993844048a849e0bbbdc468e3a4a1 /test | |
parent | 7bec9e3804df83f4333fabcbb7e0030046fad389 (diff) | |
download | afl++-a609b08c0ad1c3e9825604b3b97b634ac9bf344c.tar.gz |
portability fixes: avoid bash, avoid echo -e under NetBSD
Diffstat (limited to 'test')
-rwxr-xr-x | test/test.sh | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/test.sh b/test/test.sh index d230cf71..6f6fe693 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Ensure we have: test, type, diff -q, echo -e, grep -aqE, timeout @@ -15,15 +15,15 @@ diff -q test.1 test.2 >/dev/null 2>&1 || OK= rm -f test.1 test.2 test -z "$OK" && { echo Error: diff -q is not working ; exit 1 ; } -ECHO="echo -e" -$ECHO '\x41' 2>&1 | grep -qE '^A' || { +ECHO="printf %b\\n" +$ECHO \\101 2>&1 | grep -qE '^A' || { ECHO= - test -e /bin/echo && { - ECHO="/bin/echo -e" - $ECHO '\x41' 2>&1 | grep -qE '^A' || ECHO= + test -e /bin/printf && { + ECHO="/bin/printf %b\\n" + $ECHO '\\101' 2>&1 | grep -qE '^A' || ECHO= } } -test -z "$ECHO" && { echo Error: echo command does not support -e option ; exit 1 ; } +test -z "$ECHO" && { printf Error: printf command does not support octal character codes ; exit 1 ; } export AFL_EXIT_WHEN_DONE=1 export AFL_SKIP_CPUFREQ=1 @@ -40,12 +40,12 @@ unset AFL_LLVM_LAF_SPLIT_SWITCHES unset AFL_LLVM_LAF_TRANSFORM_COMPARES unset AFL_LLVM_LAF_SPLIT_COMPARES -GREY="\\x1b[1;90m" -BLUE="\\x1b[1;94m" -GREEN="\\x1b[0;32m" -RED="\\x1b[0;31m" -YELLOW="\\x1b[1;93m" -RESET="\\x1b[0m" +GREY="\\033[1;90m" +BLUE="\\033[1;94m" +GREEN="\\033[0;32m" +RED="\\033[0;31m" +YELLOW="\\033[1;93m" +RESET="\\033[0m" $ECHO "${RESET}${GREY}[*] starting afl++ test framework ..." |