Skip to content

Commit

Permalink
scripts: fuzz: add support for build and overlays
Browse files Browse the repository at this point in the history
Add support to specify an overlay file to use with the fuzz script and
another flag to build without fuzzing

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
  • Loading branch information
cujomalainey authored and lgirdwood committed Jul 26, 2023
1 parent c5f00bf commit deed9a8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scripts/fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ main()
setup

# Parse "$@". getopts stops after '--'
while getopts "ho:t:" opt; do
while getopts "ho:t:c:b" opt; do
case "$opt" in
h) print_help; exit 0;;
o) FUZZER_STDOUT="$OPTARG";;
t) TEST_DURATION="$OPTARG";;
b) BUILD_ONLY=1;;
c) OVERLAY="$OPTARG";;
*) print_help; exit 1;;
esac
done
Expand All @@ -78,7 +80,16 @@ main()
-DCONFIG_ASAN=y
)

west build -d build-fuzz -b native_posix "$SOF_TOP"/app/ -- "${fuzz_configs[@]}" "$@"
if [ ! -z $OVERLAY ]; then
overlay_config=$(xargs -a "$SOF_TOP/app/$OVERLAY" printf -- "-D%s ")
fi

west build -d build-fuzz -b native_posix "$SOF_TOP"/app/ -- \
"${fuzz_configs[@]}" "$overlay_config" "$@"

if [ $BUILD_ONLY -eq 1 ]; then
exit
fi

mkdir -p ./fuzz_corpus

Expand Down

0 comments on commit deed9a8

Please sign in to comment.