From 5273c61cd84fb5db4bd4c97509f60511c7a9bb6d Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Tue, 12 May 2020 23:19:51 +0200 Subject: Darwin tests: grep --binary-files=text for laf-intel and skipping of unittests --- GNUmakefile | 11 ++++++++++- test/test.sh | 2 +- unicorn_mode/unicornafl | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index d3e9275c..95bc1072 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -252,7 +252,7 @@ help: @echo "deepclean: cleans everything including downloads" @echo "code-format: format the code, do this before you commit and send a PR please!" @echo "tests: this runs the test framework. It is more catered for the developers, but if you run into problems this helps pinpointing the problem" - @echo "unit: perform unit tests (based on cmocka)" + @echo "unit: perform unit tests (based on cmocka and GNU linker)" @echo "document: creates afl-fuzz-document which will only do one run and save all manipulated inputs into out/queue/mutations" @echo "help: shows these build options :-)" @echo "==========================================" @@ -385,8 +385,17 @@ unit_preallocable: test/unittests/unit_preallocable.o unit_clean: @rm -f ./test/unittests/unit_preallocable ./test/unittests/unit_list ./test/unittests/unit_maybe_alloc test/unittests/*.o +ifneq "$(shell uname)" "Darwin" + unit: unit_maybe_alloc unit_preallocable unit_list unit_clean +else + +unit: + @echo [-] unit tests are skipped on Darwin \(lacks GNU linker feature --wrap\) + +endif + code-format: ./.custom-format.py -i src/*.c ./.custom-format.py -i include/*.h diff --git a/test/test.sh b/test/test.sh index 8e6c277f..6c05571b 100755 --- a/test/test.sh +++ b/test/test.sh @@ -355,7 +355,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && { } AFL_DEBUG=1 AFL_LLVM_LAF_SPLIT_SWITCHES=1 AFL_LLVM_LAF_TRANSFORM_COMPARES=1 AFL_LLVM_LAF_SPLIT_COMPARES=1 ../afl-clang-fast -o test-compcov.compcov test-compcov.c > test.out 2>&1 test -e test-compcov.compcov && { - grep -Eq " [ 12][0-9][0-9] location| [3-9][0-9] location" test.out && { + grep --binary-files=text -Eq " [ 12][0-9][0-9] location| [3-9][0-9] location" test.out && { $ECHO "$GREEN[+] llvm_mode laf-intel/compcov feature works correctly" } || { $ECHO "$RED[!] llvm_mode laf-intel/compcov feature failed" diff --git a/unicorn_mode/unicornafl b/unicorn_mode/unicornafl index 5833117a..a5b79002 160000 --- a/unicorn_mode/unicornafl +++ b/unicorn_mode/unicornafl @@ -1 +1 @@ -Subproject commit 5833117abf55d54c4191ead81312764df03a48bc +Subproject commit a5b79002ca18219c83f9aec4e71007917c6be2e0 -- cgit 1.4.1