Changeset: e81fdadbf9b0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/e81fdadbf9b0 Removed Files: testing/Mconvert.py.in testing/SQLogicConvertNotes Modified Files: MonetDB.spec documentation/source/developers_handbook.rst testing/CMakeLists.txt Branch: default Log Message:
Remove Mconvert.py. diffs (truncated from 2948 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -815,7 +815,6 @@ developer, but if you do want to test, t %files testing-python %defattr(-,root,root) -%{_bindir}/Mconvert.py %{_bindir}/Mtest.py %{_bindir}/Mz.py %{_bindir}/mktest.py diff --git a/documentation/source/developers_handbook.rst b/documentation/source/developers_handbook.rst --- a/documentation/source/developers_handbook.rst +++ b/documentation/source/developers_handbook.rst @@ -121,11 +121,6 @@ Consider the following single client con ---- 6 -Alternatively existing ``.sql`` scripts can be converted to sqllogic tests (.test) with ``Mconvert.py``. -For example:: - - $ Mconvert.py --auto <module>/Tests <convert_me>.sql - All new tests need to be placed in the appropriate test folder and their name respectively in the index ``All`` file. diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -111,10 +111,6 @@ configure_file(Mz.py.in ${CMAKE_CURRENT_BINARY_DIR}/Mz.py @ONLY) -configure_file(Mconvert.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Mconvert.py - @ONLY) - configure_file(listexports.py.in ${CMAKE_CURRENT_BINARY_DIR}/listexports.py @ONLY) @@ -127,7 +123,6 @@ install(FILES install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Mz.py - ${CMAKE_CURRENT_BINARY_DIR}/Mconvert.py PERMISSIONS ${PROGRAM_PERMISSIONS_DEFAULT} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT pytesting) diff --git a/testing/Mconvert.py.in b/testing/Mconvert.py.in deleted file mode 100755 --- a/testing/Mconvert.py.in +++ /dev/null @@ -1,2827 +0,0 @@ -#!@PYTHON@ - -# 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/. -# -# Copyright 2024 MonetDB Foundation; -# Copyright August 2008 - 2023 MonetDB B.V.; -# Copyright 1997 - July 2008 CWI. - -#TODO: -#===== -# - check all TODO's below -# - tidy -up HTML-generation by "keeping in mind" during testing, -# which OUT/ERR differ or not and which tests were skipped. -# dump HTML-stuff only at end -# print an ascii summary at end, too -# - if no diffs, but warnings, say so at end -# - produce, keep & reference LOG -# - add a "grep-like" function and replace "inlined" grep -# contains(<file>,<string>) -# - do multi-level prompting? -# - normalize all path's used -# - Python 3? (or do a full rewrite?) - -import os -import sys -import shutil -import re -import random -import time -import socket -import struct -import signal -import fnmatch -import glob -import pymonetdb # check for pymonetdb early: it is essential for our work -try: - import winreg # Python 3 on Windows -except ImportError: - winreg = None # not on Windows - -MonetDB_VERSION = '@MONETDB_VERSION@'.split('.') - -procdebug = False -verbose = False -quiet = False - -initdb = None - -global_timeout = 0 -start_time = time.time() - -# whether output goes to a tty -isatty = os.isatty(sys.stdout.fileno()) - -# default is no color (these three functions may get redefined) -def prred(str, write = sys.stdout.write): - write(str) -def prgreen(str, write = sys.stdout.write): - write(str) -def prpurple(str, write = sys.stdout.write): - write(str) -if isatty: - if os.name != 'nt': - # color output a little - RED = '\033[1;31m' - GREEN = '\033[0;32m' - PURPLE = '\033[1;35m' # actually magenta - BLACK = '\033[0;0m' - def prred(str, write = sys.stdout.write): - try: - write(RED) - write(str) - finally: - write(BLACK) - def prgreen(str, write = sys.stdout.write): - try: - write(GREEN) - write(str) - finally: - write(BLACK) - def prpurple(str, write = sys.stdout.write): - try: - write(PURPLE) - write(str) - finally: - write(BLACK) - else: - try: - import ctypes - except ImportError: - pass - else: - STD_OUTPUT_HANDLE = -11 - try: - handle = ctypes.windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE) - except AttributeError: - pass - else: - def get_csbi_attributes(handle): - # Based on IPython's winconsole.py, written by Alexander Belchenko - csbi = ctypes.create_string_buffer(22) - res = ctypes.windll.kernel32.GetConsoleScreenBufferInfo(handle, csbi) - assert res - (bufx, bufy, curx, cury, wattr, - left, top, right, bottom, maxx, maxy) = struct.unpack("hhhhHhhhhhh", csbi.raw) - return wattr - reset = get_csbi_attributes(handle) - def prred(str, - write=sys.stdout.write, - flush=sys.stdout.flush, - scta=ctypes.windll.kernel32.SetConsoleTextAttribute): - try: - flush() - scta(handle, 0x4) - write(str) - flush() - finally: - scta(handle, reset) - def prgreen(str, - write=sys.stdout.write, - flush=sys.stdout.flush, - scta=ctypes.windll.kernel32.SetConsoleTextAttribute): - try: - flush() - scta(handle, 0x2) - write(str) - flush() - finally: - scta(handle, reset) - def prpurple(str, - write=sys.stdout.write, - flush=sys.stdout.flush, - scta=ctypes.windll.kernel32.SetConsoleTextAttribute): - try: - flush() - scta(handle, 0x5) - write(str) - flush() - finally: - scta(handle, reset) - -if os.path.exists('/usr/bin/coredumpctl'): - # probably Linux if /usr/bin/coredumpctl exists - # try raising the core dump size limit to infinite so that when we - # get a crash we have a chance to retrieve the stack trace - try: - import resource - except ImportError: - pass - else: - try: - resource.setrlimit(resource.RLIMIT_CORE, - (resource.RLIM_INFINITY, - resource.getrlimit(resource.RLIMIT_CORE)[1])) - except ValueError: - # if we can't raise the limit, just forget it - pass - -def ErrExit(msg): - sys.stderr.write(msg + '\n') - sys.exit(1) - -def _configure(str): - # expand configure variables in str and return result - config = [ - ('{source}', '@QXSOURCE@'), - ('${build}', '@QXBUILD@'), - - ('${bindir}', '@QXbindir@'), -## ('${sbindir}', '@QXsbindir@'), - ('${libexecdir}', '@QXlibexecdir@'), - ('${datarootdir}', '@QXdatarootdir@'), - ('${datadir}', '@QXdatadir@'), - ('${sysconfdir}', '@QXsysconfdir@'), - ('${localstatedir}', '@QXlocalstatedir@'), - ('${libdir}', '@QXlibdir@'), - ('${includedir}', '@QXincludedir@'), -## ('${oldincludedir}', '@QXoldincludedir@'), - ('${infodir}', '@QXinfodir@'), - ('${mandir}', '@QXmandir@'), - ('${Qbindir}', '@QXbindir@'), -## ('${Qsbindir}', '@QXsbindir@'), - ('${Qlibexecdir}', '@QXlibexecdir@'), - ('${Qdatarootdir}', '@QXdatarootdir@'), - ('${Qdatadir}', '@QXdatadir@'), - ('${Qsysconfdir}', '@QXsysconfdir@'), - ('${Qlocalstatedir}', '@QXlocalstatedir@'), - ('${Qlibdir}', '@QXlibdir@'), - ('${Qincludedir}', '@QXincludedir@'), -## ('${Qoldincludedir}', '@QXoldincludedir@'), - ('${Qinfodir}', '@QXinfodir@'), - ('${Qmandir}', '@QXmandir@'), - # put these at end (in this order!) for efficiency - ('${exec_prefix}', '@QXexec_prefix@'), - ('${Qexec_prefix}', '@QXexec_prefix@'), - ('${prefix}', '@QXprefix@'), - ('${Qprefix}', '@QXprefix@'), - ] - if os.name == 'nt': - str = str.replace('%prefix%', '${prefix}') - str = str.replace('%exec_prefix%', '${exec_prefix}') - changed = True - while '$' in str and changed: - changed = False - for key, val in config: - if os.name == 'nt': - val = val.replace('%prefix%', '${prefix}') - val = val.replace('%exec_prefix%', '${exec_prefix}') - nstr = str.replace(key, val) - changed = changed or str != nstr - str = nstr - return str - -try: - from helpers import build_work_ctx -except ImportError: - try: - from MonetDBtesting.helpers import build_work_ctx - except ImportError: - p = _configure(os.path.join('@QXprefix@', '@QXPYTHON_LIBDIR@')) - sys.path.insert(0, p) - from MonetDBtesting.helpers import build_work_ctx - if 'PYTHONPATH' in os.environ: - p += os.pathsep + os.environ['PYTHONPATH'] - os.environ['PYTHONPATH'] = p - -# use our own process module because it has _BufferedPipe -try: - import process -except ImportError: - try: - import MonetDBtesting.process as process - except ImportError: - p = _configure(os.path.join('@QXprefix@', '@QXPYTHON_LIBDIR@')) - sys.path.insert(0, p) - import MonetDBtesting.process as process - if 'PYTHONPATH' in os.environ: - p += os.pathsep + os.environ['PYTHONPATH'] - os.environ['PYTHONPATH'] = p - -# Replace os.fork by a version that forks but also sets the process -# group in the child. This is done so that we can easily kill a -# subprocess and its children in case of a timeout. _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org