X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tests%2Fnon_regression_tests%2Ftest.sh;h=380bea4d601e81381afb53ee4f1e0577e3bc82f3;hb=b146572b9707292dbc1eacf5fb67d84271cafbba;hp=4b5e442c34139822ece62be22b77311b3f099c28;hpb=acb1fbf7cf8b7eb9c0ff413fa405f87f15a98b09;p=SXSI%2Fxpathcomp.git diff --git a/tests/non_regression_tests/test.sh b/tests/non_regression_tests/test.sh index 4b5e442..380bea4 100755 --- a/tests/non_regression_tests/test.sh +++ b/tests/non_regression_tests/test.sh @@ -1,15 +1,32 @@ #!/bin/sh MAIN=../../main.native -for i in *count*.xp +for i in *.xp do - echo "$i"------------------- + echo -n Test "$i" "..." ref=`basename "$i" .xp`.output doc=$(cat "$i" | cut -f 1 -d ',') options=$(cat "$i" | cut -f 2 -d ',') query=$(cat "$i" | cut -f 3 -d ',') rm -f tmp - $MAIN $options "../docs/$doc".xml "$query" /dev/stdout 2>/dev/null - cat "$ref" - echo ----------------------------------------- -done \ No newline at end of file + if [ -f "../docs/$doc".srx ] + then + input="../docs/$doc".srx + else + input="../docs/$doc".xml + fi + $MAIN $options "$input" "$query" tmp 2>/dev/null + if diff -q -w -B tmp "$ref" + then + echo " ok" + else + echo failure + echo ----------------------- + echo Difference: + diff -w -B tmp "$ref" + echo ----------------------- + echo + fi + +done +rm -f tmp \ No newline at end of file