@REMAKE@ -v PACKINCLUDE="$PACKINCLUDE" -v OCAMLDEPNATIVE="$OCAMLDEPNATIVE" -v OCAMLFORPACK="$OCAMLFORPACK" "$obj"
fi
+## Tests
+
+test_suite: tools src/@PACKAGE_TARNAME@.native@EXE@
+ for i in tests/*.xml
+ do
+ @REMAKE@ "$i".summary
+ done
+
+
+%.summary:
+ base="${1%.xml.summary}"
+ @REMAKE@ "$base".xml "$base".xml.queries
+ cat "$base".xml.queries | grep -v '^#' | while read q query; do
+ echo -n "$base"".xml $q $query ... "
+ REF="$base".xml.results/"$q"_jaxp.xml
+ @REMAKE@ "$REF"
+ OUTPUT="$base".xml.results/"$q"_@PACKAGE_TARNAME@.xml
+ LOG="$base".xml.results/"$q"_@PACKAGE_TARNAME@.log
+ src/@PACKAGE_TARNAME@.native@EXE@ -s "$base".xml \
+ "$query" "$OUTPUT" > "$LOG" 2>&1
+ echo "Query: $q : $query" > "$1"
+ cat "$LOG" | grep '^STATS' >> "$1"
+ echo -n "Diff: " >> "$1"
+ tools/xml_diff.native "$REF" "$OUTPUT" >/dev/null 2>&1
+ if [ "$?" -eq 0 ]; then
+ echo ok
+ echo ok >> "$1"
+ else
+ echo failed
+ echo failed >> "$1"
+ fi
+ echo '-------------------------------------------' >> "$1"
+ done
--- /dev/null
+Query: O4 : //L/ancestor::* | //L/descendant::*
+STATS: Query: /descendant-or-self::node()/child::L/ancestor::* | /descendant-or-self::node()/child::L/descendant::*
+STATS: Automaton:
+STATS: evaluation time: 7.114887ms
+STATS: serialization time: 0.150919ms
+STATS: 1 iterations
+STATS: automaton 0, cache2: 70 entries, cache6: 2345 entries
+STATS: cache2: length: 105, used: 35, occupation: 0.333333
+STATS: cache4: length: 2543, used: 198, occupation: 0.077861
+Diff: ok
+-------------------------------------------
--- /dev/null
+Query: C0 : /descendant::comment()
+STATS: Query: /descendant::comment()
+STATS: Automaton:
+STATS: evaluation time: 0.082016ms
+STATS: serialization time: 0.002861ms
+STATS: 1 iterations
+STATS: automaton 0, cache2: 6 entries, cache6: 18 entries
+STATS: cache2: length: 9, used: 3, occupation: 0.333333
+STATS: cache4: length: 27, used: 9, occupation: 0.333333
+Diff: ok
+-------------------------------------------
--- /dev/null
+Query: B13 : //keyword/ancestor::parlist/descendant::keyword/ancestor::parlist/descendant::keyword/ancestor::parlist/descendant::keyword
+STATS: Query: /descendant-or-self::node()/child::keyword/ancestor::parlist/descendant::keyword/ancestor::parlist/descendant::keyword/ancestor::parlist/descendant::keyword
+STATS: Automaton:
+STATS: evaluation time: 294.135094ms
+STATS: serialization time: 1.837015ms
+STATS: 4 iterations
+STATS: automaton 0, cache2: 0 entries, cache6: 2671 entries
+STATS: cache2: length: 0, used: 0, occupation: -nan
+STATS: cache4: length: 2984, used: 313, occupation: 0.104893
+Diff: ok
+-------------------------------------------
+++ /dev/null
-#!/bin/sh
-
-TESTPROG="src/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
-
-echo "Testing version: $VERSION"
-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
+++ /dev/null
-#!/bin/sh
-
-cd src
-echo `pwd`
-for dir in *
-do
- if [ -d "$dir" ]
- then
- echo "$dir"
- rm -f "$dir".mlpack
- cd "$dir"
- for i in *.ml *.mly *.mll
- do
- if [ ! -f "$i" ]
- then
- continue
- fi
- echo "$i"
- f=`echo "$i" | cut -b1`
- l=`basename "$i" .mll`
- l=`basename "$l" .mly`
- l=`basename "$l" .ml | cut -b2-`
- o=`echo "$f" | tr a-z A-Z`
- echo "$dir"/"$o""$l" >> ../"$dir".mlpack
- done
- cd ..
- fi
-done
-cd ..
\ No newline at end of file
+++ /dev/null
-#!/bin/sh
-
-PROGS="$@"
-for doc in tests/*.xml
-do
- if [ -f "$doc".queries ]
- then
- cat "$doc".queries | grep -v '^#' | while read qname q
- do
- D=""
- N=""
- echo "$qname" "$q"
- for p in $PROGS
- do
- echo "$p":
- cat "$doc".results/"$qname"_"$p".log | grep --color=never 'INFO\|time'
- N="$N_$p"
- D="$D $doc".results/"$qname"_"$p".xml
- done
-
- echo -n "Diff ... "
- DIFFILE="$doc".results/"$qname"_"$N".diff
- ./tools/xml_diff.native $D > "$DIFFILE" 2>&1
- case "$?" in
- "0")
- echo "ok"
- rm -f "$DIFFILE"
- ;;
- *)
- echo "failed"
- ;;
- esac
- echo "-------------------------------------------"
- done
- fi
-
-
-done