diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/run_tests.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/run_tests.sh b/test/run_tests.sh index 9421e85..d596daf 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -1,5 +1,7 @@ #!/bin/sh +ECHO=`which echo` + DIFF_FLAGS="-u" case "$(uname)" in *W32*) @@ -18,13 +20,13 @@ if [ -z "$testBin" ]; then if [ ! -x $testBin ] ; then testBin="../build/test/yajl_test" if [ ! -x $testBin ] ; then - echo "cannot execute test binary: '$testBin'" + ${ECHO} "cannot execute test binary: '$testBin'" exit 1; fi fi fi -echo "using test binary: $testBin" +${ECHO} "using test binary: $testBin" testsSucceeded=0 testsTotal=0 @@ -38,11 +40,11 @@ for file in cases/*.json ; do allowComments="" ;; esac - echo -n " test case: '$file': " + ${ECHO} -n " test case: '$file': " iter=1 success="success" - echo "$testBin $allowComments -b $iter < $file > ${file}.test " + ${ECHO} "$testBin $allowComments -b $iter < $file > ${file}.test " # parse with a read buffer size ranging from 1-31 to stress stream parsing while [ $iter -lt 32 ] && [ $success = "success" ] ; do $testBin $allowComments -b $iter < $file > ${file}.test 2>&1 @@ -57,11 +59,11 @@ for file in cases/*.json ; do rm ${file}.test done - echo $success + ${ECHO} $success : $(( testsTotal += 1 )) done -echo $testsSucceeded/$testsTotal tests successful +${ECHO} $testsSucceeded/$testsTotal tests successful if [ $testsSucceeded != $testsTotal ] ; then exit 1 |