X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=tools%2Fdo_tatoo.sh;fp=tools%2Fdo_tatoo.sh;h=d1eea034989580b0bd941362d7c6abc5422869a1;hp=0000000000000000000000000000000000000000;hb=6733babef61a4e4dc18eca834577b6359f0a1345;hpb=9522266372edb18327f96b21213b4efc3798ee98 diff --git a/tools/do_tatoo.sh b/tools/do_tatoo.sh new file mode 100755 index 0000000..d1eea03 --- /dev/null +++ b/tools/do_tatoo.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +TESTPROG="./tatoo.native" +VERSION="$(git log -1 --oneline | cut -f1 -d ' ' 2>/dev/null)" +if [ -z "$VERSION" ] +then + SUFFIX=tatoo +else + SUFFIX=tatoo_"$VERSION" +fi + +usage() { + echo "error: missing input, query file, xml_diff or $TESTPROG" + echo "usage: $0 file.xml" +} + +FILE="$1" +RESULTS="$FILE".results +QUERIES="$FILE".queries + +if test ! -f "$FILE" -o ! -f "$QUERIES" -o ! -f "$TESTPROG" +then + usage; + exit 1 +fi + + +mkdir -p "$RESULTS" + +cat "$QUERIES" | grep -v '^#' | while read qname q +do + echo -n "Testing $qname: $q ... " + "$TESTPROG" "$FILE" "$q" > "$RESULTS"/"$qname"_"$SUFFIX".xml 2> "$RESULTS"/"$qname"_"$SUFFIX".log + echo "ok" +done