Skip to content

Commit

Permalink
ensure we're using the echo program on the path, at least in snow leo…
Browse files Browse the repository at this point in the history
…pard running 'echo -n' under /bin/sh outputs the '-n' rather than parsing it as an argument which means "omit trailing newline"
  • Loading branch information
lloyd committed Aug 11, 2010
1 parent f6f2085 commit d1e7708
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/run_tests.sh
@@ -1,5 +1,7 @@
#!/bin/sh

ECHO=`which echo`

DIFF_FLAGS="-u"
case "$(uname)" in
*W32*)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d1e7708

Please sign in to comment.