mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-30 14:57:50 +00:00
Refactor test.sh scripts for consistency
This commit is contained in:
@@ -3,17 +3,19 @@
|
||||
export LC_ALL=C
|
||||
|
||||
tmpdir="$(mktemp -d)"
|
||||
src="$PWD"
|
||||
tests=0
|
||||
failed=0
|
||||
rc=0
|
||||
|
||||
cp ../../{rgbfix,contrib/gbdiff.bash} "$tmpdir"
|
||||
src="$PWD"
|
||||
cd "$tmpdir" || exit
|
||||
|
||||
# Immediate expansion is the desired behavior.
|
||||
# shellcheck disable=SC2064
|
||||
trap "cd; rm -rf ${tmpdir@Q}" EXIT
|
||||
|
||||
tests=0
|
||||
failed=0
|
||||
rc=0
|
||||
|
||||
bold="$(tput bold)"
|
||||
resbold="$(tput sgr0)"
|
||||
red="$(tput setaf 1)"
|
||||
@@ -111,7 +113,6 @@ rc=$((rc || $? != 1))
|
||||
tryDiff "$src/noexist.err" out.err noexist.err
|
||||
rc=$((rc || $?))
|
||||
|
||||
|
||||
if [[ "$failed" -eq 0 ]]; then
|
||||
echo "${bold}${green}All ${tests} tests passed!${rescolors}${resbold}"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user