X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fcomparison_tests%2Ftest_cache.sh;fp=tests%2Fcomparison_tests%2Ftest_cache.sh;h=de275a77c4e4272d27b222517c31f0a3567f2c15;hb=5f371ee50291faed9ae0514dfd4ba2aec87faea1;hp=0000000000000000000000000000000000000000;hpb=8907c4fc162a27e946d6b574102dc3c97075c4e1;p=SXSI%2Fxpathcomp.git diff --git a/tests/comparison_tests/test_cache.sh b/tests/comparison_tests/test_cache.sh new file mode 100755 index 0000000..de275a7 --- /dev/null +++ b/tests/comparison_tests/test_cache.sh @@ -0,0 +1,23 @@ +#!/bin/bash +source utils.sh +DOC="$2" +cat "$1" | grep -v '^#' | while read line +do + QNAME=`echo "$line" | cut -f 1 -d '%'` + QUERY=`echo "$line" | cut -f 2 -d '%'` + echo -n "$QNAME", + for mode in "-nc -nj" "-nc" "-nj" "" + do + output=`../../main.native -r "4" $mode -c "$DOC" "$QUERY" 2>&1` + #echo "$output" + time=`echo "$output" | grep "Execution time" | cut -f 2 -d',' | cut -f1 -d ':' | grep -o '[0-9.]*'` + TIME_COUNT=`echo "$time" | tail -n +2 | average` + echo -n "$TIME_COUNT" + if [ -z "$mode" ] + then + echo + else + echo -n "," + fi + done +done