X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=Remakefile.in;h=8f6dbb75c477962bb072cd9d058c91363c9807fc;hp=e38e3b9b208464ad8b1753ddb778fe8bf52561b4;hb=f7a43114461b09d79c94a0da51ffbe1aea43dc55;hpb=f8128e98f2f4d61309fdb4b24e12eb33b08d630c diff --git a/Remakefile.in b/Remakefile.in index e38e3b9..8f6dbb7 100644 --- a/Remakefile.in +++ b/Remakefile.in @@ -21,7 +21,7 @@ OCAMLYACC = @OCAMLYACC@ all: $(BIN) -tools: tools/xml_diff.native$(EXE) tools/XPathEval.class +tools: tools/xml_diff.native$(EXE) tools/XPathEval.class tools/split_path.native$(EXE) Remakefile: Remakefile.in config.status ./config.status Remakefile @@ -59,7 +59,7 @@ distclean: clean test_clean base=$* src=${base}.ml obj=${base}.cmx - dir=`dirname "$@"` + dir=src $(REMAKE) -v OCAMLDEPNATIVE=-native "$obj" srcs=`ls "$dir"/*.cmx | sed 's/\.cmx/.ml/g'` objs=`$(OCAMLDEP) $(OCAMLDEPNATIVE) $(OCAMLFINDFLAGS) -modules $srcs | tools/osort.sh cmx` @@ -69,7 +69,7 @@ distclean: clean test_clean base=$* src=${base}.ml obj=${base}.cmo - dir=`dirname "$@"` + dir=src $(REMAKE) "$obj" objs="" for i in "$dir"/*.cmi; do @@ -157,27 +157,36 @@ distclean: clean test_clean ## Tests -test: +test: tools $(BIN) for i in tests/*.xml do - $(REMAKE) "$i".summary + for j in 1 2 3 + do + $(REMAKE) "$i".test"$j".summary + done done test_clean: - rm -rf tests/*.summary tests/*.results/*_"$(PACKAGE)".* + rm -rf tests/*.summary tests/*.results/*_"$(PACKAGE)"_*.* -%.summary: - base=`dirname "$@"`/`basename "$@" .xml.summary` - $(REMAKE) "$base".xml "$base".xml.queries tools "$(BIN)" +%.test1.summary: + base="$@" + base=${base%.xml.test1.summary} + $(REMAKE) "$base".xml "$base".xml.queries rm -f "$@" + MSG="Test 1 (single query: tatoo vs java implementation)" + echo "$MSG" >> "$@" + echo "$MSG" 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)".xml - LOG="$base".xml.results/"$q"_"$(PACKAGE)".log - src/@PACKAGE_TARNAME@.native@EXE@ -s "$base".xml \ - "$query" "$OUTPUT" > "$LOG" 2>&1 + OUTPUT="$base".xml.results/"$q"_"$(PACKAGE)"_test1.xml + LOG="$base".xml.results/"$q"_"$(PACKAGE)"_test1.log + cp "$@" /tmp + src/@PACKAGE_TARNAME@.native@EXE@ -s -d "$base".xml \ + "$query" -o "$OUTPUT" > "$LOG" 2>&1 + cp "$@" /tmp echo "Query: $q : $query" >> "$@" cat "$LOG" | grep '^STATS' >> "$@" echo -n "Diff: " >> "$@" @@ -191,3 +200,75 @@ test_clean: fi echo '-------------------------------------------' >> "$@" done + +%.test2.summary: + base="$@" + base=${base%.xml.test2.summary} + $(REMAKE) "$base".xml "$base".xml.queries + rm -f "$@" + MSG="Test 2 (all queries sequentially vs all queries in parallel)" + echo "$MSG" >> "$@" + echo "$MSG" + allqueries=`cat "$base".xml.queries | grep -v '^#' | while read q query; do echo "'$query'"; done` + echo -n "Running all queries ... " + OUTPUTA="$base".xml.results/test2a_"$(PACKAGE)".xml + LOG="$base".xml.results/test2a_"$(PACKAGE)".log + echo -n "sequential ... " + echo "$allqueries" | xargs src/@PACKAGE_TARNAME@.native@EXE@ -s -d "$base".xml \ + -o "$OUTPUTA" > "$LOG" 2>&1 + cat "$LOG" | grep '^STATS' >> "$@" + + OUTPUTB="$base".xml.results/test2b_"$(PACKAGE)".xml + LOG="$base".xml.results/test2b_"$(PACKAGE)".log + echo -n "parallel ... " + echo "$allqueries" | xargs src/@PACKAGE_TARNAME@.native@EXE@ -p -s -d "$base".xml \ + -o "$OUTPUTB" > "$LOG" 2>&1 + cat "$LOG" | grep '^STATS' >> "$@" + echo -n "Diff: " >> "$@" + if diff "$OUTPUTA" "$OUTPUTB" >/dev/null 2>&1; then + echo ok + echo ok >> "$@" + else + echo failed + echo failed >> "$@" + exit 1 + fi + echo '-------------------------------------------' >> "$@" + +%.test3.summary: + base="$@" + base=${base%.xml.test3.summary} + $(REMAKE) "$base".xml "$base".xml.queries + rm -f "$@" + MSG="Test 3 (multiple queries composition: sequential vs parallel)" + echo "$MSG" >> "$@" + echo "$MSG" + cat "$base".xml.queries | grep -v '^#' | while read q query; do + echo -n "$base"".xml $q $query ... sequential ... " + OUTPUTA="$base".xml.results/"$q"_"$(PACKAGE)"_test3a.xml + LOG="$base".xml.results/"$q"_"$(PACKAGE)"_test3a.log + src/@PACKAGE_TARNAME@.native@EXE@ -s -d -C "$base".xml \ + -o "$OUTPUTA" $(src/split_path.native$(EXE) "$query") > "$LOG" 2>&1 + echo "Query: $q : $query" >> "$@" + cat "$LOG" | grep '^STATS' >> "$@" + + echo -n "parallel ... " + OUTPUTB="$base".xml.results/"$q"_"$(PACKAGE)"_test3a.xml + LOG="$base".xml.results/"$q"_"$(PACKAGE)"_test3a.log + src/@PACKAGE_TARNAME@.native@EXE@ -s -d -p -C "$base".xml \ + -o "$OUTPUTB" $(src/split_path.native$(EXE) "$query") > "$LOG" 2>&1 + echo "Query: $q : $query" >> "$@" + cat "$LOG" | grep '^STATS' >> "$@" + + + echo -n "Diff: " >> "$@" + if diff "$OUTPUTA" "$OUTPUTB" >/dev/null 2>&1; then + echo ok + echo ok >> "$@" + else + echo failed + echo failed >> "$@" + exit 1 + fi + echo '-------------------------------------------' >> "$@" + done