| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Imcludes test snippets contained in docstrings, too.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Since Python 2.2, the object returned by an os.stat() call presents
attributes matching the 10-tuple of stat values. Use these instead of
indexing into the tuple.
As usual for non-removed tests, minor tweaks made if needed -
copyright header and DefautlEnvironment() call for performance.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most interesting is an "api change" - the test methods test.must_exist()
and test.must_exist_one_of() now take an optional 'message' keyword
argument which is passed on to fail_test() if the test fails.
The regex used to test an exception is now working for Python 3.13,
and enabled conditionally - the "enhanced error reporting" changed, in
a way that made it easy to reuse the existing regex (if somebody wants
to take a shot at unifying them, more power!).
Also one unexpected issue was found - one of the check routines does
"output = os.newline.join(output)", but there is no os.newline. Could use
os.linesep, but just changed it to the Python newline character.
Some annotations added, and some cleanup done on possibly unsafe uses
- mainly that self.stderr() and selt.stdout() *can* return None, but
several places in the code just did string operations on the return
unconditionally. There's already precendent- other places did do a check
before using, so just extended the concept to possibly vulnerable palces.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
| |
Some of these got done in the tool conversion, some not,
so picked up the rest manually.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use: https://github.com/JelleZijlstra/autotyping
to add "safe" return annotations.
Where a parameter has a default value that is an obvious scalar type
(bool, int, str, etc.) add those annotations as well.
Also fixed two small bugs that popped up when sanity-checking with
mypy. One in FortranCommon, where a return had been previously
annotated to be a tuple of Action, which should be ActionBase -
Action is the factory function, not the base class. The other was
a typo in the error raised in _add_cppdefines - the message was
formatted with the value of "define" which should have been "defines".
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |\
| |
| |
| | |
add_logging_to_new_parallel_job
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a mostly tool-based conversion (a couple added by hand),
and other changes were not made, to try to keep the diff manageable.
Adds a GitHub Action to run framework tests if framework changes.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
| |
| |
| | |
of the file. It's no longer there. Added TestCommon.detailed_diff() function which can be used to diff large text blobs expected vs actual
|
| |/
|
|
| |
--taskmastertracefor (NewParallel/LegacyParallel Jobs). Now uses golden files to compare expected output and output files
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Since Python 3.3, the subprocess module has its own timeout
implementation, so remove the test framework's custom one.
Required a little rejigger since the subprocess timeout is done
on the communicate() call, not set up before the test is started.
Noted that the framework intends to support two levels:
one for the testing class instance, and one for an individual
start call, which should override the one in the instance.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
| |
to stdout after the original message
|
| |
|
|
|
|
|
|
|
| |
- super used where direct call to superclass existed
- convert a few older-style super() (two-argument) uses
- in a few places, where there was an intersection with a super change,
variables that override a builtin (e.g. "dict") were renamed.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On a system where SCons is started from the mingw bash shell, and
mingw Python is the interpreter, the secondary self-identification differs.
Use that in a few tests which otherwise make the wrong decision.
EnvironmentTests used an invalid value for CCFLAGS, and empty
string is a better choice.
Change a couple of cases where Python code was run directly so
it's prefixed by the-Python-in-use, which fails if there is not
a Windows-registered program for .py files - we didn't really want
to use the Windows-native Python anyway.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Eliminate unneeded imports, and a few unneeded statements -
usually "pass" where it is not syntactically needed.
A couple of import try blocks were eliminated or changed
when they're "cannot happen" due to current floor Python version.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Some Py2/Py3 compat blocks were simplified to Py3 only
* some sequences of define-cleaup-function + atexit.register
were changed to use the decorator (this works if func needs to
take no arguments)
* Lightly update a bunch of docstrings in TestCmd, and reformat
a few places, towards the style we're generally using now.
* call_python() in TestCmdTests was modernized to use subprocess.run
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A couple of minor reformats along the way, most prominently, in tests,
if being edited anyway, make sure the docstring most tests have is
actually the docstring (sometimes the __revision__ line came before,
which makes the string not be the docstring).
Snuck in some minor framework changes that were orphaned when another
draft PR was not needed: this almost all docstring changes, the
functional part is using casefold instead of lower in a match func -
a slightly better approach which is now possible that Py2 compatibility
is not needed.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
| |\
| |
| |
| | |
fix_java_tests_path_with_spaces
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
|
|
| |
TestCommon's options_arguments to keep passed lists and not join them into a string.
|
| |
|
|
|
|
|
|
|
|
| |
Instead of custom conversion as in the previous iteration,
use the to_bytes function.
The two known tests which incorrectly let the text-mode xml file
be opened in binary mode are adjusted to supply mode='r'
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
TestCommon defines a method must_contain which checks for a file including
a given string. With Python 3, the test runs into some typing problems.
This could be fixed either by changing all the tests which call the
routine either omitting the mode argument (which then defaults to 'rb'),
or specifying a mode which includes 'b'; or by modifying must_contain to
align the types of the file data and the data to check for. This patch
uses the latter approach.
This is a test-only change, no run-time scons code is modified.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|
|
quite some time
|