first: setup
setting up repo.
This commit is contained in:
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
# test-all.sh — compile the benchmark helper tools first, then run every
|
||||
# benchmark (coreutils and busybox). Exits non-zero if any of them fails.
|
||||
#
|
||||
# usage: ./test-all.sh
|
||||
set -u
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# 1. build the helper tools before running any benchmark so createtxt()
|
||||
# can use the fast C generator instead of the slow shell fallback
|
||||
mkdir -p "$SCRIPT_DIR/tools"
|
||||
if ! cc -O2 -Wall -o "$SCRIPT_DIR/tools/genfile" "$SCRIPT_DIR/tools/genfile.c"; then
|
||||
printf 'test-all: error: failed to compile %s\n' "$SCRIPT_DIR/tools/genfile.c" >&2
|
||||
exit 1
|
||||
fi
|
||||
printf 'built %s\n' "$SCRIPT_DIR/tools/genfile"
|
||||
|
||||
# 2. run each benchmark (both run regardless, so every result is reported)
|
||||
"$SCRIPT_DIR/bench-coreutils.sh"
|
||||
rc_coreutils=$?
|
||||
"$SCRIPT_DIR/bench-busybox.sh"
|
||||
rc_busybox=$?
|
||||
|
||||
# 3. summarize
|
||||
if [[ $rc_coreutils -ne 0 || $rc_busybox -ne 0 ]]; then
|
||||
printf '\ntest-all: FAILED (coreutils=%s, busybox=%s)\n' "$rc_coreutils" "$rc_busybox" >&2
|
||||
exit 1
|
||||
fi
|
||||
printf '\ntest-all: all benchmarks passed\n'
|
||||
Reference in New Issue
Block a user