Changeset: fecc5e462123 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fecc5e462123 Removed Files: testing/Mtest.py.in.old Branch: mtest Log Message:
Don't check in backups of files: that's what we have a history for. diffs (truncated from 4745 to 300 lines): diff --git a/testing/Mtest.py.in.old b/testing/Mtest.py.in.old deleted file mode 100755 --- a/testing/Mtest.py.in.old +++ /dev/null @@ -1,4740 +0,0 @@ -#!@PYTHON@ - -# 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 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. - -#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 -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: - import Mfilter -except ImportError: - try: - import MonetDBtesting.Mfilter as Mfilter - except ImportError: - p = _configure(os.path.join('@QXprefix@', '@QXPYTHON_LIBDIR@')) - sys.path.insert(0, p) - import MonetDBtesting.Mfilter as Mfilter - 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: - import MonetDBtesting.process as process - -# 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. -# To use this, set the global variable setpgrp to True before calling -# subprocess.Popen. It is reset automatically to False so that -# subprocess of our child don't get their own process group. -try: - os.setpgrp -except AttributeError: - try: - os.setpgid - except AttributeError: - # no function to set process group, so don't replace - pass - else: - # use os.setpgid to set process group - def myfork(osfork = os.fork): - global setpgrp - _setpgrp = setpgrp - setpgrp = False - pid = osfork() - if pid == 0 and _setpgrp: - os.setpgid(0, 0) - return pid - os.fork = myfork -else: - # use os.setpgrp to set process group - def myfork(osfork = os.fork): - global setpgrp - _setpgrp = setpgrp - setpgrp = False - pid = osfork() - if pid == 0 and _setpgrp: - os.setpgrp() - return pid - os.fork = myfork -setpgrp = False - -try: - ttywidth = os.get_terminal_size(1).columns -except: - ttywidth = 0 -else: - if ttywidth > 0 and os.name == 'nt': - ttywidth -= 1 # don't go to the edge - -import string # for whitespace -def splitcommand(cmd): - '''Like string.split, except take quotes into account.''' - q = None - w = [] - command = [] - for c in cmd: - if q: - if c == q: - q = None - else: - w.append(c) - elif c in string.whitespace: - if w: - command.append(''.join(w)) - w = [] - elif c == '"' or c == "'": - q = c _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list