Implement set-theoretic operation on 2WSATA (union, intersection,
[tatoo.git] / tests / test2.sh
1 #!/bin/sh
2
3 MSG="Test 2 (all queries sequentially vs all queries in parallel)"
4 echo "$MSG" >> "$target"
5 echo "$MSG"
6 allqueries=`cat "${xml}".queries | grep -v '^#' | while read q query; do echo "'$query'"; done`
7 echo -n "Running all queries ... "
8 OUTPUTA="$xml".results/test2a_"$PACKAGE".xml
9 LOG="$xml".results/test2a_"$PACKAGE".log
10 echo -n "sequential ... "
11 echo "$allqueries" | xargs $BIN -s -d "$xml" -o "$OUTPUTA" > "$LOG" 2>&1
12 cat  "$LOG" | grep '^STATS' >> "$target"
13
14 OUTPUTB="$xml".results/test2b_"$PACKAGE".xml
15 LOG="$xml".results/test2b_"$PACKAGE".log
16 echo -n "parallel ... "
17 echo "$allqueries" | xargs $BIN -p -s -d "$xml" -o "$OUTPUTB" > "$LOG" 2>&1
18 cat  "$LOG" | grep '^STATS' >> "$target"
19 echo -n "Diff: " >> "$target"
20 if diff "$OUTPUTA" "$OUTPUTB" >/dev/null 2>&1; then
21     echo ok
22     echo ok >> "$target"
23 else
24     echo failed
25     echo failed >> "$target"
26     exit 1
27 fi
28 echo '-------------------------------------------' >> "$target"