summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLloyd Hilaiel <lloyd@hilaiel.com>2010-08-10 21:46:42 -0600
committerLloyd Hilaiel <lloyd@hilaiel.com>2010-08-10 21:46:42 -0600
commitd1e770838efaa76811f1cd8930d19d13b14fbc2b (patch)
treebde77e77d8324d4c1170a38d5ad6e9106fb9d2c3 /test
parentf6f2085b0ca6061c31872920a3da399b8b6cc4eb (diff)
downloadyajl-d1e770838efaa76811f1cd8930d19d13b14fbc2b.tar.gz
ensure we're using the echo program on the path, at least in snow leopard running 'echo -n' under /bin/sh outputs the '-n' rather than parsing it as an argument which means "omit trailing newline"
Diffstat (limited to 'test')
-rwxr-xr-xtest/run_tests.sh14
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