diff options
| author | Josh Wainwright <josh.wainwright@ldra.com> | 2016-04-25 11:31:05 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-26 09:28:30 +0200 |
| commit | 13499cc0d53277f7604eec2009476c1655cd8ba9 (patch) | |
| tree | a5d1920647ba2277ebdbc8c46f33d232e410b347 /lua/test.sh | |
| parent | e3b465dd8dc70ef7f9de45d9bc06ef47cb251848 (diff) | |
| download | vis-13499cc0d53277f7604eec2009476c1655cd8ba9.tar.gz vis-13499cc0d53277f7604eec2009476c1655cd8ba9.tar.xz | |
Change shebang to sh and add quotes to variables in script
Diffstat (limited to 'lua/test.sh')
| -rw-r--r-- | lua/test.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lua/test.sh b/lua/test.sh index 7fc515b..cedad08 100644 --- a/lua/test.sh +++ b/lua/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh [ -z "$VIS" ] && VIS="../../vis" $VIS -v @@ -10,7 +10,7 @@ export VIS_PATH=. export VIS_THEME=theme if [ $# -gt 0 ]; then - test_files=$@ + test_files=$* else test_files="$(find . -type f -name "*.in") basic_empty_file.in" fi @@ -19,25 +19,25 @@ for t in $test_files; do TESTS_RUN=$((TESTS_RUN + 1)) t=${t%.in} t=${t#./} - $VIS $t.in + $VIS "$t".in printf "%-30s" "$t" - if [ -e $t.out ]; then - if cmp -s $t.ref $t.out 2> /dev/null; then + if [ -e "$t".out ]; then + if cmp -s "$t".ref "$t".out 2> /dev/null; then printf "PASS\n" TESTS_OK=$((TESTS_OK + 1)) else printf "FAIL\n" - diff -u $t.ref $t.out > $t.err + diff -u "$t".ref "$t".out > "$t".err fi - elif [ -e $t.status ]; then - if ! grep -v true $t.status > /dev/null; then + elif [ -e "$t".status ]; then + if ! grep -v true "$t".status > /dev/null; then printf "PASS\n" TESTS_OK=$((TESTS_OK + 1)) else printf "FAIL\n" - printf "$t\n" > $t.err - grep -vn true $t.status >> $t.err + printf "%s\n" "$t" > "$t".err + grep -vn true "$t".status >> "$t".err fi else printf "FAIL\n" |
