Rename directory non_regression_tests to comparison_tests
[SXSI/xpathcomp.git] / tests / comparison_tests / test_cache.sh
1 #!/bin/bash
2 source utils.sh
3 DOC="$2"
4 cat "$1" | grep -v '^#' | while read line 
5 do
6     QNAME=`echo "$line" | cut -f 1 -d '%'`
7     QUERY=`echo "$line" | cut -f 2 -d '%'`
8     echo -n "$QNAME",
9     for mode in "-nc -nj" "-nc" "-nj" ""
10     do
11         output=`../../main.native -r "4" $mode -c "$DOC" "$QUERY" 2>&1`
12         #echo "$output"
13         time=`echo "$output" | grep "Execution time" | cut -f 2 -d',' | cut -f1 -d ':' | grep -o '[0-9.]*'`
14         TIME_COUNT=`echo "$time" | tail -n +2 | average`
15         echo -n "$TIME_COUNT"
16         if [ -z "$mode" ]
17         then
18             echo
19         else
20             echo -n ","
21         fi
22     done
23 done