X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tests%2Fcomparison_tests%2Fsxsi.sh;fp=tests%2Fcomparison_tests%2Fsxsi.sh;h=6221e8312c48345b544c391db0bb7a28d7ea4fca;hb=adbae5267917033dec93e753bbc81272d16ab218;hp=0000000000000000000000000000000000000000;hpb=8f5b2f0c7e95245c1b7f4cc18aa137ba8e784166;p=SXSI%2Fxpathcomp.git diff --git a/tests/comparison_tests/sxsi.sh b/tests/comparison_tests/sxsi.sh new file mode 100755 index 0000000..6221e83 --- /dev/null +++ b/tests/comparison_tests/sxsi.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +source utils.sh + +function do_sxsi() { + query="$1" + count="$4" + doc=`basename "$2" .xml`.srx + repeat="$3" + TIME_MAT="" + TIME_COUNT="" + TIME_PRINT="" + NUM_RESULTS="" + output=`./main.native -r "$3" -c -b "$doc" "$query" 2>&1` + echo "$output" >> sxsi_debug.log + NUM_RESULT=`echo "$output" | grep "Number of results" | grep -o '[0-9]*'` + 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` + if [ -z "$count" ] + then + output=`./main.native -b -r "$3" "$doc" "$query" /dev/null 2>&1` + mtime=`echo "$output" | grep "Execution time" | cut -f 2 -d',' | cut -f1 -d ':'| grep -o '[0-9.]*'` + ptime=`echo "$output" | grep 'Serialization time' | cut -f 3 -d ' ' | grep -o '[0-9.]*'` + TIME_MAT=`echo "$mtime" | tail -n +2 | average` + TIME_PRINT="$ptime" + else + TIME_MAT="999999" + TIME_PRINT="0" + fi + + echo "$TIME_COUNT" + echo "$TIME_MAT" + echo "$TIME_PRINT" + echo $NUM_RESULT +} + +do_sxsi "$@"