Skip to content

Commit

Permalink
Placate shellcheck through shameful ignorance
Browse files Browse the repository at this point in the history
  • Loading branch information
tokenrove committed Oct 17, 2017
1 parent 77285ce commit feb9d76
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions validate
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ yellow() { attr 3; }
reset() { tput me || tput sgr0; }
die() { echo "$@"; exit 1; }

# I'm legit guilty about the couple of disabled shellcheck warnings in
# this file. They are far from the biggest portability issues in this
# code, though, sadly.
#
# shellcheck disable=SC2166
if [ $# -lt 1 -o $# -gt 3 ]; then
die "Usage: validate PATH_TO_SHELL [STAGE] [NUMBER]"
fi
Expand All @@ -34,6 +39,7 @@ fi
# build helpers
for c in "$byos"/helpers/*.c; do
exe="$byos"/helpers/"$(basename "$c" .c)"
# shellcheck disable=SC2166,SC2039
if [ ! -x "$exe" -o "$c" -nt "$exe" ]; then "$c"; fi
done

Expand All @@ -42,7 +48,7 @@ trap 'rm -f $log' EXIT

do_stage() {
stage=$1
echo -n "$(yellow)$(basename "$stage"):$(reset) "
printf '%s%s:%s ' "$(yellow)" "$(basename "$stage")" "$(reset)"
for t in "$stage"/*.t; do
do_test "$stage" "$t"
done
Expand All @@ -54,7 +60,7 @@ do_test() {
test=$2
if "$byos"/helpers/timeout 15 \
"$byos"/helpers/harness.tcl "$test" "$sh_under_test" > "$log"; then
echo -n "$(green)$(basename "$test")$(reset) "
printf '%s%s%s ' "$(green)" "$(basename "$test")" "$(reset)"
else
echo "$(red)$(basename "$test")$(reset)"
echo
Expand Down

0 comments on commit feb9d76

Please sign in to comment.