about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-05-12 23:19:51 +0200
committerhexcoder- <heiko@hexco.de>2020-05-12 23:19:51 +0200
commit5273c61cd84fb5db4bd4c97509f60511c7a9bb6d (patch)
tree7cf63e095d167ab6025767785f7ce05e8566bf30
parent0c1c947aaf758368558dadd027b8a6503ba2c20f (diff)
downloadafl++-5273c61cd84fb5db4bd4c97509f60511c7a9bb6d.tar.gz
Darwin tests: grep --binary-files=text for laf-intel and skipping of unittests
-rw-r--r--GNUmakefile11
-rwxr-xr-xtest/test.sh2
m---------unicorn_mode/unicornafl0
3 files changed, 11 insertions, 2 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
-Subproject 5833117abf55d54c4191ead81312764df03a48b
+Subproject a5b79002ca18219c83f9aec4e71007917c6be2e