Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/fuzz/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ libfdt="src/libfdt/fdt.c src/libfdt/fdt_ro.c src/libfdt/fdt_rw.c src/libfdt/fdt_
# The C files under test go next to nothing but themselves, so that their #include "utils.h"
# finds the host stand-in in tests/fuzz/host instead of src/utils.h
python3 -I tests/fuzz/src_copy.py "$out/src_copy.c"
cp src/kboot_audio.c src/devicetree.c "$out/"
cp src/kboot_audio.c src/adt_gpio.c src/devicetree.c "$out/"

# shellcheck disable=SC2086
$CC $cflags $incs tests/fuzz/adt_fuzz.c "$out/libadt_fuzz.a" -lpthread -ldl -lm -o "$out/adt-fuzz"
# shellcheck disable=SC2086
$CC $cflags -I"$root/tests/fuzz/host" $incs tests/fuzz/dt_fuzz.c "$out/src_copy.c" "$out/devicetree.c" \
"$out/kboot_audio.c" $libfdt "$out/libadt_fuzz.a" -lpthread -ldl -lm -o "$out/dt-fuzz"
"$out/kboot_audio.c" "$out/adt_gpio.c" $libfdt "$out/libadt_fuzz.a" -lpthread -ldl -lm -o "$out/dt-fuzz"
# pmgr.c includes ../build/build_cfg.h, which only a firmware build generates
mkdir -p "$out/src" "$out/build"
: >"$out/build/build_cfg.h"
Expand Down
4 changes: 2 additions & 2 deletions tests/python/test_fuzz_regress.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ def test_dt_fuzz_regress(adt_lib, tmp_path):
src.mkdir()
subprocess.run([sys.executable, "-I", str(FUZZ / "src_copy.py"), str(src / "src_copy.c")],
check=True)
for name in ("kboot_audio.c", "devicetree.c"):
for name in ("kboot_audio.c", "adt_gpio.c", "devicetree.c"):
shutil.copy(ROOT / "src" / name, src / name)
libfdt = [ROOT / "src/libfdt" / name for name in (
"fdt.c", "fdt_ro.c", "fdt_rw.c", "fdt_wip.c", "fdt_sw.c", "fdt_strerror.c", "fdt_check.c",
"fdt_empty_tree.c", "fdt_addresses.c")]
binary = build(adt_lib, "dt-replay",
[FUZZ / "dt_fuzz.c", src / "src_copy.c", src / "devicetree.c",
src / "kboot_audio.c", *libfdt],
src / "kboot_audio.c", src / "adt_gpio.c", *libfdt],
incs=["-I", str(FUZZ / "host")])
replay(binary, sorted(seeds.iterdir()) + sorted((FUZZ / "regress/dt").glob("*")))

Expand Down
Loading