| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The code in testing/framework/TestSCons.py attempted to handle an
ImportError if ninja is not available. However, when running individual
test files from the scons/test/ directory, this directory is included as
the first entry in sys.path. When this happens, the `import ninja`
statement succeeds, finding the scons/test/ninja/ directory and treating
it as a package. This results in an AttributeError being thrown later
attempting to access `ninja.BIN_DIR`, rather than an ImportError.
I have confirmed that this change now allows `./runtest.py test/Help.py`
to succeed, even when ninja is not installed.
|
| |
|
|
|
|
| |
Imcludes test snippets contained in docstrings, too.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
| |
|
|
| |
longer works starting with python ninja package version 1.11.1.2
|
| |\
| |
| | |
Remove Python 3.6 support
|
| | | |
|
| |/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Don't """code block""" % locals() if there's not actually a substitution
in the code block. While there, fix any old-style file headers,
and add a DefaultEnvironment call if not present.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |\
| |
| | |
Deprecate Python 3.6 support.
|
| | |\ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
No claim is made about when it will actually be dropped,
but some notice seems polite.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Simplify/clarify some usage of Python version strings. Dropped a couple
which refer to unsupported versions.
While looking at version usage, it became clear one of the SWIG tests
wasn't doing the right thing - it has a special case for Windows, where
the way the path to the Python library is constructed would only work
for the python.org release, not the Store version. Since we compute
this information correclty in the test framework, and the test already
called that routine - before ignoring the results - just use that instead.
Though it turns out the framework didn't quite do the right thing either,
returning a bare lib name without the library suffix - fixed that, too.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
The try block in TestCmd.start() is removed, it interferes with
other things. TestCommon.start is supposed to handle exceptions,
so inserting more stuff at a lower level (parent class) made
a mess of the framework tests.
Clean up a complaint with later Pythons (3.12+), and include
(incomplete) new regex for Python 3.13+.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
| |
re.sub's count and flags arguments are transitioning to keyword-only.
With 3.13a5, usage as positional args issues a DeprecationWarning,
which caused one SCons test to fail. Updated in test framework
and in bin/update-release-info.py.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ pyupgrade --py36-plus $(<filelist)
Here's mostly what it's done:
- No more 'stringliteral'.encode('utf-8'): now b'stringliteral'
- No more unicode literals
- the default open mode is 'r', leaves out if default
- some f-string conversions (if shorter)
- catch OSError instead of subclasses
- no more mention of "object"
- generator expression instead of list comp. when safe
- a few tests had a shebang but actually began with blank line
- remove coding: utf-8 comment, per pep 3120 this is the default now
Manually - if a file in test/ was modified, then did the copyright
header conversion.
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>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| |
| | |
fix_configure_marking_up_to_date
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| |
| |
| | |
adding DefaultEnvironment calls with no tools
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The mocked tools mylex.py and myyacc.py now understand the file-generation
options, and generate a dummy file with predictable contents, for
checking. This allows more testing of the path through the SCons support
for these two without needing live commands.
New tests added which invoke the file-generation options, and make
sure the extra files are created, and that SCons detects and tracks
the added targets. Work is done in a subdirectory, which exposes some
existing known inconsistent behavior (the regular generated file goes
in the subdir per the LEXCOM and YACCOM generated line, while the ones
generated from commandline options go in the topdir) - but we're going
to allow that behavior to continue for backwards compat.
Same fix applied to yacc tool that PR #4168 did for lex - do subst_list()
instead of subst() to preserve spaces in paths. That fix left the lex
tool unable to pass the new test, as it could not see the individual
arguments in the FLAGS variable, which was solved by indexing into the
subst'd list so we can iterate over the args again.
Test and tool cleanup; add DefaultEnvironment calls, etc.
Note this mentions, but does not address the problem described in issue 4154.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |/
|
|
| |
info cleared after check.
|
| |
|
|
| |
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
| |
- 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>
|
| |\
| |
| | |
Fix tests to not hang on Windows with bad .py assoc
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For systems where the association for .py files is not to an actual
Python interpreter, those few cases where we need to run a Python script
directly as a program don't work. This could be because the association
was never set up, or because some other program (e.g. Visual Studio Code)
has taken it over. In some cases may appear to "hang" because the
alternate program is waiting for user interaction
runtest.py now has a mechanism to check (thanks to Brett Cannon for
providing this incantation). It isn't super precise (looks for the
substring "py" in the queried association), but should work out.
It sets an environment variable which the test framework can read
and as a result set a flag which individual tests can read.
Two tests in scons-time which had previously been set to skip-if-win32
now look at this flag instead. Three tests in sconsign now also look at
this flag. This allows a clean run on my dev box with VS Code having
taken over the .py association.
Various things can break if the environment used to fire off
Windows processes doesn't contain %UserProfile%. Added this to the
short list of passthrough env vars. Apparently an environment without
this value is now considered invalid (it blew up the erroneously
launched VS Code, but we've apparently been lucky it hasn't blown
up more things - believe there was also a report of a problem
with the Visual Studio setup scripts).
A little extra cleanup:
- a couple of Py2-isms were cleaned out (Script/Main.py and in the test
framework)
- The paths to look for site-scons were rewritten (part of this was
another Py2-ism), and the system path changed a bit - the old path is
still checked, and the manpage updated to reflect this.
- runtest.py dropped the unused whereis functions.
- the three sconsign tests now use f-string formatting, mostly as an
experiment to see how easy it is to convert.
Fixes #4053
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |/ |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modified failing tests to use the new defaulted .sconsign database based on the hash algorithm
For MD5, default database will be .sconsign.dblite
For other algorithms the default will be .sconsign_<hashname>.dblite.
For all cases where the user changes the hash algorithm used, the database will be .sconsign_<hashname>.dblite (including md5)
For sub-scons directories it remains as .sconsign
Also added unit-tests for Util.py for the new hash default changes.
It's difficult to setup a fips-compliant platform using containers, and instead we mock that.
option--config uses multiple types of hash algorithms so was skipped.
Removed one f-string (python 3.5 doesn't support those)
Corrupt.py is using an explicit .sconsign so that was left as-is, and only the parent default .sconsign was changed for work test 1.
A fetch-database name option was added to the testing framework.
The unlink_sconsignfile was not updated as no usages of it were found.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Still failing on:
SCons/UtilTests.py
test/Configure/ConfigureDryRunError.py
test/Configure/implicit-cache.py
test/Configure/option--config.py
test/option/hash-format.py
test/option/option-n.py
test/question/Configure.py
These tests all have hardcoded md5 sums or use md5 directly
Next commit should fix it so the md5-specific tests are skipped if fips mode detected.
Also will figure out a way around the hardcoded m5sums.
|
| |
|
|
|
|
|
|
| |
There is a new stub java/javac/jar/java_home on the Mac, probably after
the Oracle license change to Java (though that part is only a guess).
Updated the detection code to handle the new way.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
| |
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
A line is now emitted showing sconsign sync time if --debug=time
Some calls to time.time replaced with time.perf_counter, where the
objective was to time sections of code (i.e. where there wasn't
an actual need to get time-since-epoch) - Python recommends this
as getting the best-available timer.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
| | |
|