Permalink
Browse files

Removed bash dependency in test/run_tests.sh and updated for NetBSD.

  • Loading branch information...
1 parent 61e78ca commit 734aee05a16de1a7eed572f444f21d5f9a1e5034 @sgravrock committed Dec 22, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 test/run_tests.sh
View
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
ECHO=`which echo`
@@ -70,19 +70,19 @@ for file in cases/*.json ; do
$testBin $allowPartials $allowComments $allowGarbage $allowMultiple -b $iter < $file > ${file}.test 2>&1
diff ${DIFF_FLAGS} ${file}.gold ${file}.test > ${file}.out
if [ $? -eq 0 ] ; then
- if [ $iter -eq 31 ] ; then : $(( testsSucceeded += 1)) ; fi
@sgravrock
sgravrock Dec 22, 2012 owner

I'm not clear on what the colon operator was being used for, here and elsewhere. On NetBSD sh, the expressions that followed it had no effect. The result was a bogus failure if this colon was left in or an infinite loop if the one on line 80 was left in. It seems to work fine without them on bash as well as NetBSD sh, but this could use another pair of eyes just to be safe.

+ if [ $iter -eq 31 ] ; then testsSucceeded=$(( $testsSucceeded + 1 )) ; fi
else
success="FAILURE"
iter=32
${ECHO}
cat ${file}.out
fi
- : $(( iter += 1 ))
+ iter=$(( iter + 1 ))
rm ${file}.test ${file}.out
done
${ECHO} $success
- : $(( testsTotal += 1 ))
+ testsTotal=$(( testsTotal + 1 ))
done
${ECHO} $testsSucceeded/$testsTotal tests successful

0 comments on commit 734aee0

Please sign in to comment.