X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tests%2Fcomparison_tests%2Ftest.sh;fp=tests%2Fcomparison_tests%2Ftest.sh;h=40ddcd4be6cf5f99c7749a2e5938d9ca218794ac;hb=5f371ee50291faed9ae0514dfd4ba2aec87faea1;hp=0000000000000000000000000000000000000000;hpb=8907c4fc162a27e946d6b574102dc3c97075c4e1;p=SXSI%2Fxpathcomp.git diff --git a/tests/comparison_tests/test.sh b/tests/comparison_tests/test.sh new file mode 100755 index 0000000..40ddcd4 --- /dev/null +++ b/tests/comparison_tests/test.sh @@ -0,0 +1,151 @@ +#!/bin/bash +I=1 + +function cecho() { + case "$1" in + green) + START="\033[0;32m" + END="\033[0m" + ;; + yellow) + START="\033[1;33m" + END="\033[0m" + ;; + red) + START="\033[0;31m" + END="\033[0m" + ;; + *) + START="" + END="" + ;; + esac + echo -n -e "${START}${2}${END}" +} + +function lessthan() { + echo '5k 1 st 0 sf' "$2" "$1" '> "$SLOG" + echo "$I,$monet_count,$monet_count_time,$monet_mat_time,$monet_print_time" >>"$MLOG" + echo "$I,$qizx_count,$qizx_count_time,$qizx_mat_time,$qizx_print_time" >>"$QLOG" + echo -n "Correctness: " + if [ "$monet_count" = "$sxsi_count" ] + then + cecho green "count ok ($monet_count) " + else + cecho red "count error (monetdb: $monet_count, sxsi: $sxsi_count) " + fi + echo + echo -n "Timing: " + CTIME="SXSI: $sxsi_count_time +MONET: $monet_count_time +QIZX: $qizx_count_time" + SORTED_CTIME=`echo "$CTIME" | sort --key=2 -g` + STR_CTIME=`echo "$SORTED_CTIME" | xargs echo -n` + first=`echo "$STR_CTIME" | cut -f1 -d':'` + if [ "$first" = "SXSI" ] + then + cecho green "$STR_CTIME" + else + cecho yellow "$STR_CTIME" + fi + I=$(( $I + 1)) + echo +done +done