From 13499cc0d53277f7604eec2009476c1655cd8ba9 Mon Sep 17 00:00:00 2001 From: Josh Wainwright Date: Mon, 25 Apr 2016 11:31:05 +0100 Subject: Change shebang to sh and add quotes to variables in script --- lua/test.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lua/test.sh') 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" -- cgit v1.2.3