Skip to content
Open
Changes from all commits
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
16 changes: 14 additions & 2 deletions util/run-gnu-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,21 @@ echo "path_UUTILS='${path_UUTILS}'"
echo "path_GNU='${path_GNU}'"

# Use GNU nproc for *BSD
NPROC=$(command -v ${path_GNU}/src/nproc||command -v nproc)
MAKEFLAGS="${MAKEFLAGS} -j ${NPROC}"
NPROC_COMMAND=$(command -v "${path_GNU}/src/nproc" || command -v nproc || :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NPROC_COMMAND=$(command -v "${path_GNU}/src/nproc" || command -v nproc || :)
NPROC_COMMAND=$(command -v "${path_GNU}/src/nproc" || command -v nproc || echo 2)

and drop unnecessary if block.

if [ -z "${NPROC_COMMAND}" ] || [ ! -x "${NPROC_COMMAND}" ]; then
echo "Error: unable to find an executable nproc command at '${path_GNU}/src/nproc' or in PATH" >&2
exit 1
fi
JOBS=$("${NPROC_COMMAND}")
case "${JOBS}" in
'' | 0 | *[!0-9]*)
echo "Error: '${NPROC_COMMAND}' returned an invalid job count: '${JOBS}'" >&2
exit 1
;;
esac
MAKEFLAGS="${MAKEFLAGS:+${MAKEFLAGS} }-j${JOBS}"
export MAKEFLAGS
echo "GNU test make job count: ${JOBS}"
###

cd "${path_GNU}" && echo "[ pwd:'${PWD}' ]"
Expand Down
Loading