2024bfff2406aca2a65354db4e5719fa290922a2
[SXSI/xpathcomp.git] / tests / non_regression_tests / test.sh
1 #!/bin/sh
2
3 MAIN=../../main.native
4 for i in *.xp
5 do
6     echo -n Test "$i" "..."
7     ref=`basename "$i" .xp`.output
8     doc=$(cat "$i" | cut -f 1 -d ',')
9     options=$(cat "$i" | cut -f 2 -d ',')
10     query=$(cat "$i" | cut -f 3 -d ',')
11     rm -f tmp
12     if [ -f "../docs/$doc".srx ]
13     then
14         input="../docs/$doc".srx
15     else
16         input="../docs/$doc".xml
17     fi
18     $MAIN $options "$input" "$query" tmp 2>/dev/null
19     if diff -q -w -B tmp "$ref"
20     then
21         echo " ok"
22     else
23         echo failure
24         echo -----------------------
25         echo Difference:
26         diff -w -B tmp "$ref"
27         echo -----------------------
28         echo
29     fi
30
31 done