summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-08-31 07:58:36 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-08-31 07:58:36 (GMT)
commit3dc33d18452de871cff98914dda81ff00b4d00f6 (patch)
treedb6b1db8f12e688ecfa32e2d8908c20a5ce18037 /Lib/test
parent39cf04b7bb84122d263c6e3738cf67bccda72e63 (diff)
downloadcpython-3dc33d18452de871cff98914dda81ff00b4d00f6.zip
cpython-3dc33d18452de871cff98914dda81ff00b4d00f6.tar.gz
cpython-3dc33d18452de871cff98914dda81ff00b4d00f6.tar.bz2
Revert 57722. Move error dialog APIs to msvcrt instead,
add -n option to regrtest, and use it on the buildbot.
Diffstat (limited to 'Lib/test')
-rwxr-xr-xLib/test/regrtest.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 552f14e..a51c576 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -28,6 +28,7 @@ Command line options:
-L: runleaks -- run the leaks(1) command just before exit
-R: huntrleaks -- search for reference leaks (needs debug build, v. slow)
-M: memlimit -- run very large memory-consuming tests
+-n: nowindows -- suppress error message boxes on Windows
If non-option arguments are present, they are names for tests to run,
unless -x is given, in which case they are names for tests not to run.
@@ -210,13 +211,13 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
test_support.record_original_stdout(sys.stdout)
try:
- opts, args = getopt.getopt(sys.argv[1:], 'dhvgqxsS:rf:lu:t:TD:NLR:wM:',
+ opts, args = getopt.getopt(sys.argv[1:], 'dhvgqxsS:rf:lu:t:TD:NLR:wM:n',
['help', 'verbose', 'quiet', 'generate',
'exclude', 'single', 'random', 'fromfile',
'findleaks', 'use=', 'threshold=', 'trace',
'coverdir=', 'nocoverdir', 'runleaks',
'huntrleaks=', 'verbose2', 'memlimit=',
- 'debug', 'start='
+ 'debug', 'start=', "nowindows"
])
except getopt.error as msg:
usage(msg)
@@ -296,6 +297,21 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
use_resources.remove(r)
elif r not in use_resources:
use_resources.append(r)
+ elif o in ('-n', '--nowindows'):
+ import msvcrt
+ msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS|
+ msvcrt.SEM_NOALIGNMENTFAULTEXCEPT|
+ msvcrt.SEM_NOGPFAULTERRORBOX|
+ msvcrt.SEM_NOOPENFILEERRORBOX)
+ try:
+ msvcrt.CrtSetReportMode
+ except AttributeError:
+ # release build
+ pass
+ else:
+ for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]:
+ msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE)
+ msvcrt.CrtSetReportFile(m, msvcrt.CRTDBG_FILE_STDERR)
if generate and verbose:
usage("-g and -v don't go together!")
if single and fromfile: