diff options
| author | lloydh <lloydh@e775cfb5-b74b-0410-aad5-5bebe4a96390> | 2008-01-14 18:14:48 +0000 |
|---|---|---|
| committer | lloydh <lloydh@e775cfb5-b74b-0410-aad5-5bebe4a96390> | 2008-01-14 18:14:48 +0000 |
| commit | d2174b16c8040d27a9af67c97d5434f244ed653f (patch) | |
| tree | ac519c412d9bec17e32f9f94b33ec3eb04cba78d | |
| parent | e0141e6b44ef2eb601d06e40c537aff5ae4d91eb (diff) | |
| download | yajl-d2174b16c8040d27a9af67c97d5434f244ed653f.tar.gz | |
run_tests.sh now works on both unix and win32
git-svn-id: http://yajl-c.googlecode.com/svn/yajl/trunk@96 e775cfb5-b74b-0410-aad5-5bebe4a96390
| -rwxr-xr-x | test/run_tests.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/test/run_tests.sh b/test/run_tests.sh index 4146b3e..ac6868b 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -1,12 +1,22 @@ #!/usr/bin/env bash -testBin="../build/test/yajl_test" +DIFF_FLAGS="-u" +if [[ `uname` == *W32* ]] ; then + DIFF_FLAGS="-wu" +fi +# find test binary on both platforms +testBin="../build/test/Debug/yajl_test.exe" if [[ ! -x $testBin ]] ; then - echo "cannot execute test binary: '$testBin'" - exit 1; + testBin="../build/test/yajl_test" + if [[ ! -x $testBin ]] ; then + echo "cannot execute test binary: '$testBin'" + exit 1; + fi fi +echo "using test binary: $testBin" + let testsSucceeded=0 let testsTotal=0 @@ -24,7 +34,7 @@ for file in cases/*.json ; do # parse with a read buffer size ranging from 1-31 to stress stream parsing while (( $iter < 32 )) && [ $success == "success" ] ; do $testBin $allowComments -b $iter < $file > ${file}.test 2>&1 - diff -u ${file}.gold ${file}.test + diff ${DIFF_FLAGS} ${file}.gold ${file}.test if [[ $? == 0 ]] ; then if (( $iter == 31 )) ; then let testsSucceeded+=1 ; fi else |
