X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tests%2Fnon_regression_tests%2Ftest.sh;h=380bea4d601e81381afb53ee4f1e0577e3bc82f3;hb=b146572b9707292dbc1eacf5fb67d84271cafbba;hp=f4a9106a952110a85b034c4fe4cd01641def8277;hpb=4b52da1a20a4fe031930bb96d2ca46bec06dc529;p=SXSI%2Fxpathcomp.git diff --git a/tests/non_regression_tests/test.sh b/tests/non_regression_tests/test.sh index f4a9106..380bea4 100755 --- a/tests/non_regression_tests/test.sh +++ b/tests/non_regression_tests/test.sh @@ -1,143 +1,32 @@ -#!/bin/bash -I=1 +#!/bin/sh -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" '/dev/null + if diff -q -w -B tmp "$ref" then - monet_count="$sxsi_count" - fi - if [ "$sxsi_count" = "" ] - then - sxsi_count="$monet_count" - fi - for v in sxsi_count_time sxsi_mat_time sxsi_print_time \ - monet_count_time monet_mat_time monet_print_time \ - qizx_count_time qizx_mat_time qizx_print_time - do - if [ "${!v}" = "" ] - then - { read "$v"; } < <( echo 7200000 ) - fi - done - - - - echo "$I,$sxsi_count,$sxsi_count_time,$sxsi_mat_time,$sxsi_print_time" >> "$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) " + echo " ok" else - cecho red "count error (monetdb: $monet_count, sxsi: $sxsi_count) " + echo failure + echo ----------------------- + echo Difference: + diff -w -B tmp "$ref" + echo ----------------------- + echo 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 +rm -f tmp \ No newline at end of file