summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2021-04-13 16:21:35 (GMT)
committerMats Wichmann <mats@linux.com>2021-04-13 17:14:09 (GMT)
commit5f97909ef9d17de0f895650684046277bc1a5a88 (patch)
tree24e184d0f6ecc8f71cca4c8e8f695c5046759285 /bin
parentb9c0b5f3da700836ce50c202e94fff02307a6d3c (diff)
downloadSCons-5f97909ef9d17de0f895650684046277bc1a5a88.zip
SCons-5f97909ef9d17de0f895650684046277bc1a5a88.tar.gz
SCons-5f97909ef9d17de0f895650684046277bc1a5a88.tar.bz2
Test harness add a from_fw to skip calls
Main functional change is a new kwarg to skip_test() to allow calls from inside the framework to skip an additional line of traceback in the skip output - i.e. don't just skip the entry for skip_test, but also the function in the fw that called it. Other functional change is for the try block in skip_if_not_msvc() (which is one of the internal callers of skip_test() mentioned for the other change) to catch Exception, thus avoiding system-existing exceptions that were caught by the existing bare except, which caused the skip to not actually skip. The remainder of the patch is docstring reformatting, some minor code reformats, top-of-file license blocks, etc. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'bin')
-rw-r--r--bin/scons-test.py60
-rw-r--r--bin/scons-time.py19
2 files changed, 48 insertions, 31 deletions
diff --git a/bin/scons-test.py b/bin/scons-test.py
index da92765..868688c 100644
--- a/bin/scons-test.py
+++ b/bin/scons-test.py
@@ -1,19 +1,46 @@
#!/usr/bin/env python
+
+# MIT License
#
-# A script that takes an scons-src-{version}.zip file, unwraps it in
-# a temporary location, and calls runtest.py to execute one or more of
-# its tests.
+# Copyright The SCons Foundation
#
-# The default is to download the latest scons-src archive from the SCons
-# web site, and to execute all of the tests.
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
#
-# With a little more work, this will become the basis of an automated
-# testing and reporting system that anyone will be able to use to
-# participate in testing SCons on their system and regularly reporting
-# back the results. A --xml option is a stab at gathering a lot of
-# relevant information about the system, the Python version, etc.,
-# so that problems on different platforms can be identified sooner.
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+"""
+scons-test.py - test a particular SCons version.
+
+Takes an scons-src-{version}.zip file, unwraps it in a temporary location,
+and calls runtest.py to execute one or more of its tests.
+
+The default is to download the latest scons-src archive from the SCons
+web site, and to execute all of the tests.
+
+With a little more work, this will become the basis of an automated
+testing and reporting system that anyone will be able to use to
+participate in testing SCons on their system and regularly reporting
+back the results. A --xml option is a stab at gathering a lot of
+relevant information about the system, the Python version, etc.,
+so that problems on different platforms can be identified sooner.
+"""
+
import atexit
import getopt
import os
@@ -22,16 +49,7 @@ import sys
import tempfile
import time
import zipfile
-
-try:
- # try Python 3.x style
- from urllib.request import urlretrieve
-except ImportError:
- # nope, must be 2.x; this hack is equivalent
- import imp
- # protect import from fixer
- urlretrieve = imp.load_module('urllib',
- *imp.find_module('urllib')).urlretrieve
+from urllib.request import urlretrieve
helpstr = """\
Usage: scons-test.py [-f zipfile] [-o outdir] [-v] [--xml] [runtest arguments]
diff --git a/bin/scons-time.py b/bin/scons-time.py
index e7087e7..44f0775 100644
--- a/bin/scons-time.py
+++ b/bin/scons-time.py
@@ -1,15 +1,8 @@
#!/usr/bin/env python
-#
-# scons-time - run SCons timings and collect statistics
-#
-# A script for running a configuration through SCons with a standard
-# set of invocations to collect timing and memory statistics and to
-# capture the results in a consistent set of output files for display
-# and analysis.
-#
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +23,13 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""
+scons-time - run SCons timings and collect statistics
+
+A script for running a configuration through SCons with a standard set
+of invocations to collect timing and memory statistics and to capture
+the results in a consistent set of output files for display and analysis.
+"""
import getopt
import glob