Make the non-regression testing more robust by feeding the output
[SXSI/xpathcomp.git] / tests / non_regression_tests / gen_output.sh
1 #!/bin/sh
2
3
4 for i in *.xp
5 do
6     out=`basename "$i" .xp`.output
7     doc=$(cat "$i" | cut -f 1 -d ',')
8     if grep -q -- -c "$i" >/dev/null 2>&1
9     then
10         opt="-c"
11     else
12         opt=""
13     fi
14     query=$(cat "$i" | cut -f 3 -d ',')
15     rm -f tmp
16     ../scripts/xpath.sh $opt "$query" ../docs/"$doc".xml > tmp
17     ../../main.native -nw tmp '/child::*' "$out"
18 done
19 rm -f tmp