
* fixing? * more * delete macos build_and_run fuzzers as its runtime exceeds 360minutes and can't fix it
53 lines
1.3 KiB
TOML
53 lines
1.3 KiB
TOML
# Variables
|
|
[env]
|
|
FUZZER_NAME='fuzzer_sd'
|
|
PROJECT_DIR = { script = ["pwd"] }
|
|
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
|
|
PROFILE = { value = "release" }
|
|
PROFILE_DIR = {value = "release" }
|
|
LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc'
|
|
FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}'
|
|
|
|
# Compilers
|
|
[tasks.cc]
|
|
command = "cargo"
|
|
args = ["build" , "--profile", "${PROFILE}", "--bin", "libafl_cc"]
|
|
|
|
# Harness
|
|
[tasks.fuzzer]
|
|
command = "cargo"
|
|
args = ["build" , "--profile", "${PROFILE}", "--bin", "${FUZZER_NAME}"]
|
|
dependencies = [ "cc" ]
|
|
|
|
# Run the fuzzer
|
|
[tasks.run]
|
|
command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}"
|
|
dependencies = [ "fuzzer" ]
|
|
|
|
# Test
|
|
[tasks.test]
|
|
linux_alias = "test_unix"
|
|
mac_alias = "test_unix"
|
|
windows_alias = "unsupported"
|
|
|
|
[tasks.test_unix]
|
|
script_runner = "@shell"
|
|
script='''
|
|
timeout 30s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME} >fuzz_stdout.log || true
|
|
if [ -z "$(grep "objectives: 1" fuzz_stdout.log)" ]; then
|
|
echo "Fuzzer does not generate any testcases or any crashes"
|
|
exit 1
|
|
else
|
|
echo "Fuzzer is working"
|
|
fi
|
|
'''
|
|
dependencies = [ "fuzzer" ]
|
|
|
|
# Clean up
|
|
[tasks.clean]
|
|
# Disable default `clean` definition
|
|
clear = true
|
|
script_runner="@shell"
|
|
script='''
|
|
cargo clean
|
|
''' |