Changeset: 3dda778afe69 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/3dda778afe69 Removed Files: testing/convert_to_sqllogic.sh testing/hashstableout.py testing/tfducktest.py Branch: default Log Message:
Removed some unused files. diffs (truncated from 364 to 300 lines): diff --git a/testing/convert_to_sqllogic.sh b/testing/convert_to_sqllogic.sh deleted file mode 100755 --- a/testing/convert_to_sqllogic.sh +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/env bash - -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# For copyright information, see the file debian/copyright. - -set -e - -usage() { -echo "USAGE $(basename $0) [OPTION ...] [FILE...]" -echo "DESCRIPTION: Converts old sql scripts to sqllogic scripts." -echo "OPTIONS:" -echo " -s|--src-dir <source dir> directory with old sql tests." -echo " -t|--dst-dir <destination dir> destination dotrectory for *.test sqllogic tests." -echo " -o|--overwrite <bool> overwrites existing .test" -echo " -d|--dry-run dry run" -echo -} - - -src= -dst= -dry_run= -overwrite= -srvpid= - -mapi_port=$((30000 + RANDOM%10)) -db=sqllogictest -dbpath="/tmp/sqllogictest" - -for arg in "$@" -do - case $arg in - -s|--src-dir) - src=$(pwd)/$2 - dst=$src - shift - shift - ;; - -t|--dst-dir) - dst=$2 - shift - shift - ;; - -d|--dry-run) - dry_run="true" - shift - ;; - -o|--overwrite) - overwrite="true" - shift - ;; - esac -done - -start_mserver5() { - local extra=$1 - local opt="--debug=10 --set gdk_nr_threads=0 --set mapi_listenaddr=all --set mapi_port=$mapi_port --forcemito --dbpath=$dbpath" - if [[ -n $extra ]];then - opt+=" $extra"; - fi - echo $opt - mserver5 $opt > /dev/null 2>&1 & - srvpid=$! - local i - for ((i = 0; i < 100; i++)); do - if [[ -f ${dbpath}/.started ]]; then - echo "mserver5 started port=$mapi_port pid=$srvpid" - break - fi - sleep 1 - done - if ((i == 100)); then - kill -KILL ${srvpid} - exit 1 - fi -} - -stop_mserver5() { - echo "killing mserver5 ..."; - kill -TERM $srvpid; - wait $srvpid -} - -files=() -if [[ -d "${src}" ]];then - for f in $(ls $src);do - files+=" $src/$f"; - done -fi - -for f in $@;do - if [[ -f $f ]];then - files+=" $f"; - fi -done - -if [[ -p /dev/stdin ]];then - while read line;do - if [[ -f $line ]];then - files+=" $line"; - fi - done -fi - -if [[ -z $files ]];then - usage; - exit 1; -fi - -if [[ -z "${dst}" ]];then - echo "ERROR: need --dest-dir"; - usage; - exit 1; -fi -[[ -d "${dst}" ]] || mkdir -p ${dst}; - -dryrun() { - local f=$1; - ext=$(echo "${f#*.}"); - lang='sql'; - if [[ $ext == "malC" ]];then - lang='mal' - fi - cat $f | mktest.py --database $db --port $mapi_port --language $lang; -} - -work() { - local f=$1; - local dst=$2; - if [[ "${dry_run}" = true ]];then - dryrun $f; - else - ext=$(echo "${f#*.}"); - lang='sql'; - if [[ $ext == "malC" ]];then - lang='mal' - fi - if [[ -e $dst ]];then - if [[ "$overwrite" = "true" ]];then - echo ">>> overwriting $dst ..."; - cat $f | mktest.py --database $db --port $mapi_port --language $lang > $dst; - else - echo "$dst already exists!" - fi - else - echo ">>> converting $f ..."; - cat $f | mktest.py --database $db --port $mapi_port --language $lang > $dst; - fi - fi -} - -if [[ -d $dbpath ]];then - rm -rf $dbpath; - mkdir -p $dbpath; -fi - -srv_opt= -if [[ -s ${src}/SingleServer ]];then - while IFS= read -r line;do - srv_opt+=" $line" - done < ${src}/SingleServer - echo "found extra mserver5 options $srv_opt" -fi - -start_mserver5 "$srv_opt" -sleep 3 -for f in $files;do - ext=$(echo "${f#*.}"); - if [[ $ext == "sql.in" ]];then - bn=$(basename $f .sql.in); - work $f $dst/$bn.test.in; - continue - fi - if [[ $ext == "sql" ]];then - bn=$(basename $f .sql); - work $f $dst/$bn.test; - fi - if [[ $ext == "malC" ]];then - bn=$(basename $f .malC); - work $f $dst/$bn.maltest; - fi -done; -stop_mserver5 - -rm -rf $dbpath - -if [[ -e ${src}/All ]];then - [[ ${src} -ef ${dst} ]] || cp ${src}/All $dst; -fi - -if [[ -e ${src}/SingleServer ]];then - [[ ${src} -ef ${dst} ]] || cp ${src}/SingleServer $dst; -fi -echo "Done" diff --git a/testing/hashstableout.py b/testing/hashstableout.py deleted file mode 100644 --- a/testing/hashstableout.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python3 - -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# For copyright information, see the file debian/copyright. - -import hashlib -import re -import sys -import argparse - -parser = argparse.ArgumentParser(description='produce sqllogic test results from .stable.out') -parser.add_argument('--hashlimit', action='store', type=int, default=10, - help='hash limit') -parser.add_argument( - 'files', metavar='str', nargs='+', type=str, help='files to be processed') -opts = parser.parse_args() - -def parse_header(line:str): - col_types='' - cols = line.split(',') - for col in cols: - col = col.replace('%', '').replace('#', '').replace('type', '').strip() - if col =='int': - col_types+='I' - elif col in ('real', 'double', 'decimal'): - col_types+='R' - else: - col_types+='T' - txt = 'query {} nosort'.format(col_types) - return {'col_types': col_types, 'txt': txt} - -def parse_row(columns, line: str): - def map_fn(x): - x = x.strip() - if x.startswith('\"') and x.endswith('\"'): - x = x[1:-1] - return x - row = list(map(map_fn, line.split(','))) - nrow = [] - for i in range(len(columns)): - if row[i] is None or row[i] == 'NULL': - nrow.append('NULL') - elif columns[i] == 'I': - if row[i] == 'true': - nrow.append('1') - elif row[i] == 'false': - nrow.append('0') - else: - nrow.append('%d' % int(row[i])) - elif columns[i] == 'T': - if row[i] == '': - nrow.append('(empty)') - else: - nval = [] - for c in str(row[i]): - if ' ' <= c <= '~': - nval.append(c) - else: - nval.append('@') - nrow.append(''.join(nval)) - elif columns[i] == 'R': - nrow.append('%.3f' % float(row[i])) - return tuple(nrow) - -def print_result(header, values): - if len(values) > 0: - cols = len(values[0]) - rows = len(values) - nvalues = cols*rows - print('---------------------') - print(header['txt']) - if nvalues < opts.hashlimit: - for row in values: - for col in row: - print(col) - else: - m = hashlib.md5() - for row in values: - for col in row: - m.update(bytes(col, encoding='ascii')) - m.update(b'\n') - h = m.hexdigest() - print('{} values hashing to {}'.format(nvalues, h)) - -def work(fpath): - hdr_rgx = re.compile(r'^%.*\#\s*type$') _______________________________________________ checkin-list mailing list -- [email protected] To unsubscribe send an email to [email protected]
