Factor Remakefie and add more tests for parallel query composition.
[tatoo.git] / tests / test3.sh
diff --git a/tests/test3.sh b/tests/test3.sh
new file mode 100644 (file)
index 0000000..d10bf04
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+MSG="Test 3 (multiple queries composition: sequential vs parallel)"
+echo "$MSG" >> "$target"
+echo "$MSG"
+cat "${xml}".queries | grep -v '^#' | while read q query; do
+    echo -n "${xml} $q $query ... sequential ... "
+    OUTPUTA="${xml}".results/"$q"_"$PACKAGE"_test3a.xml
+    LOG="${xml}".results/"$q"_"$PACKAGE"_test3a.log
+    $SPLIT "$query" | xargs $BIN -s -C -d "${xml}" -o "$OUTPUTA"  > "$LOG" 2>&1
+    echo "Query: $q : $query" >> "$target"
+    cat  "$LOG" | grep '^STATS' >> "$target"
+
+    echo -n "parallel ... "
+    OUTPUTB="${xml}".results/"$q"_"$PACKAGE"_test3b.xml
+    LOG="${xml}".results/"$q"_"$PACKAGE"_test3b.log
+    $SPLIT "$query" | xargs $BIN -s -p -C -d  "${xml}" -o "$OUTPUTB"  > "$LOG" 2>&1
+    echo "Query: $q : $query" >> "$target"
+    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"
+done