X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=tests%2Fxpath%2Ftest2.sh;fp=tests%2Fxpath%2Ftest2.sh;h=9b0ef34b75a3a46fa573cf7e35b7d79b8fbf861f;hp=0000000000000000000000000000000000000000;hb=3fadb034bfc0075d420bdd1383214014500501b8;hpb=c5fc33c2eda7c2bb45c3bafbe74827f17e215fb8 diff --git a/tests/xpath/test2.sh b/tests/xpath/test2.sh new file mode 100644 index 0000000..9b0ef34 --- /dev/null +++ b/tests/xpath/test2.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +MSG="Test 2 (all queries sequentially vs all queries in parallel)" +echo "$MSG" >> "$target" +echo "$MSG" +allqueries=`cat "${xml}".queries | grep -v '^#' | while read q query; do echo "'$query'"; done` +echo -n "Running all queries ... " +OUTPUTA="$xml".results/test2a_"$PACKAGE".xml +LOG="$xml".results/test2a_"$PACKAGE".log +echo -n "sequential ... " +echo "$allqueries" | xargs $BIN -s -d "$xml" -o "$OUTPUTA" > "$LOG" 2>&1 +cat "$LOG" | grep '^STATS' >> "$target" + +OUTPUTB="$xml".results/test2b_"$PACKAGE".xml +LOG="$xml".results/test2b_"$PACKAGE".log +echo -n "parallel ... " +echo "$allqueries" | xargs $BIN -p -s -d "$xml" -o "$OUTPUTB" > "$LOG" 2>&1 +cat "$LOG" | grep '^STATS' >> "$target" +echo -n "Diff: " >> "$target" +if diff "$OUTPUTA" "$OUTPUTB" >/dev/null 2>&1; then + echo ok + echo ok >> "$target" +else + echo failed + echo failed >> "$target" + exit 1 +fi +echo '-------------------------------------------' >> "$target"