mirror of
https://github.com/wownero/wownero.git
synced 2026-10-21 01:18:35 +02:00
tests: fix local AFL fuzz target build
This commit is contained in:
@@ -102,7 +102,7 @@ coverage:
|
|||||||
|
|
||||||
fuzz:
|
fuzz:
|
||||||
mkdir -p $(builddir)/fuzz
|
mkdir -p $(builddir)/fuzz
|
||||||
cd $(builddir)/fuzz && cmake -D STATIC=ON -D SANITIZE=ON -D BUILD_TESTS=ON -D USE_LTO=OFF -D CMAKE_C_COMPILER=afl-gcc -D CMAKE_CXX_COMPILER=afl-g++ -D ARCH="x86-64" -D CMAKE_BUILD_TYPE=fuzz -D BUILD_TAG="linux-x64" $(topdir) && $(MAKE)
|
cd $(builddir)/fuzz && cmake -D STATIC=ON -D SANITIZE=ON -D BUILD_TESTS=ON -D USE_LTO=OFF -D CMAKE_C_COMPILER=afl-gcc -D CMAKE_CXX_COMPILER=afl-g++ -D ARCH="x86-64" -D CMAKE_BUILD_TYPE=fuzz -D BUILD_TAG="linux-x64" $(topdir) && $(MAKE) -C tests/fuzz
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo "WARNING: Back-up your wallet if it exists within ./"$(deldirs)"!" ; \
|
@echo "WARNING: Back-up your wallet if it exists within ./"$(deldirs)"!" ; \
|
||||||
@@ -116,4 +116,4 @@ clean-all:
|
|||||||
[ $$CONTINUE = "y" ] || [ $$CONTINUE = "Y" ] || (echo "Exiting."; exit 1;)
|
[ $$CONTINUE = "y" ] || [ $$CONTINUE = "Y" ] || (echo "Exiting."; exit 1;)
|
||||||
rm -rf ./build
|
rm -rf ./build
|
||||||
|
|
||||||
.PHONY: all cmake-debug debug debug-test debug-test-asan debug-asan debug-all cmake-release release release-test release-all clean
|
.PHONY: all cmake-debug debug debug-test debug-test-asan debug-asan debug-all cmake-release release release-test release-all fuzz clean
|
||||||
|
|||||||
@@ -35,8 +35,8 @@
|
|||||||
|
|
||||||
#ifndef OSSFUZZ
|
#ifndef OSSFUZZ
|
||||||
|
|
||||||
#if (!defined(__clang__) || (__clang__ < 5))
|
#ifndef __AFL_LOOP
|
||||||
static int __AFL_LOOP(int)
|
static int monero_fuzz_loop(int)
|
||||||
{
|
{
|
||||||
static int once = 0;
|
static int once = 0;
|
||||||
if (once)
|
if (once)
|
||||||
@@ -44,6 +44,8 @@ static int __AFL_LOOP(int)
|
|||||||
once = 1;
|
once = 1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define monero_fuzz_loop(n) __AFL_LOOP(n)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int run_fuzzer(int argc, const char **argv, Fuzzer &fuzzer)
|
int run_fuzzer(int argc, const char **argv, Fuzzer &fuzzer)
|
||||||
@@ -65,7 +67,7 @@ int run_fuzzer(int argc, const char **argv, Fuzzer &fuzzer)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
const std::string filename = argv[1];
|
const std::string filename = argv[1];
|
||||||
while (__AFL_LOOP(1000))
|
while (monero_fuzz_loop(1000))
|
||||||
{
|
{
|
||||||
ret = fuzzer.run(filename);
|
ret = fuzzer.run(filename);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|||||||
Reference in New Issue
Block a user