From e101902aa5ecb14de3af06745a8db16b31598ecd Mon Sep 17 00:00:00 2001 From: kdeme Date: Sat, 28 Sep 2019 12:58:56 +0200 Subject: [PATCH] Add basic fuzzing build tasks config.nims file --- tests/fuzzing/config.nims | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/fuzzing/config.nims diff --git a/tests/fuzzing/config.nims b/tests/fuzzing/config.nims new file mode 100644 index 0000000..ff37614 --- /dev/null +++ b/tests/fuzzing/config.nims @@ -0,0 +1,30 @@ +proc aflSwitches() = + switch("define", "afl") + switch("define", "noSignalHandler") + switch("cc", "gcc") + switch("gcc.exe", "afl-gcc") + switch("gcc.linkerexe", "afl-gcc") + switch("out", "fuzz-afl") + +proc libFuzzerSwitches() = + switch("noMain", "") + switch("cc", "clang") + switch("passC", "-fsanitize=fuzzer,address") + switch("passL", "-fsanitize=fuzzer,address") + switch("out", "fuzz-libfuzzer") + +proc generalSwitches() = + switch("verbosity", "0") + switch("hints", "off") + switch("warnings", "off") + switch("define", "chronicles_log_level:fatal") + +task build_afl, "Build for afl fuzzing": + aflSwitches() + generalSwitches() + setCommand("c") + +task build_libfuzzer, "Build for libFuzzer fuzzing": + libFuzzerSwitches() + generalSwitches() + setCommand("c")