Rework the testing script.
[tatoo.git] / tools / do_jaxp.sh
diff --git a/tools/do_jaxp.sh b/tools/do_jaxp.sh
new file mode 100755 (executable)
index 0000000..7208ae1
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+usage() {
+    echo "error: missing input, query file"
+    echo "usage: $0 file.xml"
+}
+
+FILE="$1"
+RESULTS="$FILE".results
+QUERIES="$FILE".queries
+
+if test ! -f "$FILE" -o ! -f "$QUERIES"
+then
+   usage;
+   exit 1
+fi
+
+
+mkdir -p "$RESULTS"
+
+cat "$QUERIES" | grep -v '^#' | while read qname q
+do
+    echo "Computing $q"
+    java -cp _build/tools XPathEval "$FILE" "$q" > "$RESULTS"/"$qname"_jaxp.xml 2> "$RESULTS"/"$qname"_jaxp.log
+done