Add non-regression testing infrastructures and first tests.
[SXSI/xpathcomp.git] / tests / non_regression_tests / gen_output.sh
diff --git a/tests/non_regression_tests/gen_output.sh b/tests/non_regression_tests/gen_output.sh
new file mode 100755 (executable)
index 0000000..daacbef
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+
+for i in *.xp
+do
+    out=`basename "$i" .xp`.output
+    doc=$(cat "$i" | cut -f 1 -d ',')
+    if grep -q -- -c "$i" >/dev/null 2>&1
+    then
+        opt="-c"
+    else
+        opt=""
+    fi
+    query=$(cat "$i" | cut -f 3 -d ',')
+    ../scripts/xpath.sh $opt "$query" ../docs/"$doc".xml > "$out"
+done