Skip to content

Commit

Permalink
rebuild-testbench.sh: error when unknown arguments are passed
Browse files Browse the repository at this point in the history
Silently discarding user input is really bad.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb committed Dec 12, 2023
1 parent 2f07268 commit 62a908e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/rebuild-testbench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,16 @@ main()
esac
done

# This automagically removes the -- sentinel itself if any.
shift "$((OPTIND -1))"
# Error on spurious arguments.
test $# -eq 0 || {
print_usage
die "Unknown arguments: %s\n" "$*"
}

rebuild_testbench

printf '\n'
testbench_usage
}
Expand Down
2 changes: 2 additions & 0 deletions tools/testbench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ install(TARGETS testbench DESTINATION bin)

include(ExternalProject)

# Should we do this? Only for sof_ep, not for parser_ep?
# https://stackoverflow.com/questions/12021448/how-can-cmake-arguments-be-forwarded-to-externalproject
ExternalProject_Add(sof_ep
DOWNLOAD_COMMAND ""
SOURCE_DIR "${sof_source_directory}"
Expand Down

0 comments on commit 62a908e

Please sign in to comment.