diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d0a7575946..e5cb239f44 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -344,7 +344,7 @@ jobs: - 'libafl_bolts/**' - 'libafl_targets/**' - 'libafl_qemu/**' - - 'fuzzers/*qemu*/**' + - 'fuzzers/**/*qemu*/**' fuzzers-qemu: needs: diff --git a/fuzzers/binary_only/qemu_coverage/Makefile.toml b/fuzzers/binary_only/qemu_coverage/Makefile.toml index 97b30e62d0..979c2f83fc 100644 --- a/fuzzers/binary_only/qemu_coverage/Makefile.toml +++ b/fuzzers/binary_only/qemu_coverage/Makefile.toml @@ -288,10 +288,38 @@ rm -rf ${CARGO_MAKE_CRATE_TARGET_DIRECTORY} cargo clean ''' +[tasks.test_inner] +script_runner = "@shell" +script = ''' +cargo make ${FEATURE} || exit 1 + +cargo run --manifest-path ../../../utils/drcov_utils/Cargo.toml --bin drcov_merge -- \ + -i ${TARGET_DIR}/drcov-000.log ${TARGET_DIR}/drcov-001.log ${TARGET_DIR}/drcov-002.log ${TARGET_DIR}/drcov-003.log \ + --output ${TARGET_DIR}/drcov-merged.log || exit 1 + +TMP=$(cargo run --manifest-path ../../../utils/drcov_utils/Cargo.toml --bin drcov_dump_addrs -- \ + -i ${TARGET_DIR}/drcov-merged.log | wc -l || exit 1) + +NB_BLOCKS=$((TMP - 1)) + +echo "Nb blocks found: $NB_BLOCKS" + +if [ $NB_BLOCKS -ge 1700 ]; then + echo "Test succeeded" +else + echo "Did not find more than 1700 blocks." + exit 1 +fi +''' + [tasks.arm] command = "cargo" args = ["make", "-p", "arm", "run"] +[tasks.test_arm] +command = "cargo" +args = ["make", "-p", "arm", "test_inner"] + [tasks.aarch64] command = "cargo" args = ["make", "-p", "aarch64", "run"] @@ -300,6 +328,10 @@ args = ["make", "-p", "aarch64", "run"] command = "cargo" args = ["make", "-p", "x86_64", "run"] +[tasks.test_x86_64] +command = "cargo" +args = ["make", "-p", "x86_64", "test_inner"] + [tasks.i386] command = "cargo" args = ["make", "-p", "i386", "run"] @@ -316,4 +348,4 @@ args = ["make", "-p", "ppc", "run"] dependencies = ["arm", "aarch64", "x86_64", "i386", "mips", "ppc"] [tasks.lightweight] -dependencies = ["arm", "x86_64"] +dependencies = ["test_x86_64", "test_arm"]