| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
for now. Also fix build_libraries to have proper shlib suffix
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various tests called subdir several times with the same directory,
which is pointless. In previous code, this emitted a message
though it did not fail. Stop doing that.
The dir_fixture() method did some convoluted things to make sure
the directories to write to exist, change this around to simplify.
The subdir() method already combines the testdir, so dir_fixture
doesn't need to. Also handle more cleanly the case of the target
directory being an absolute path, which seems to have been intended,
but would not work.
Also clean up file_fixture() along the same principles.
Change the subdir() method to not need to be given an ordered
list of directories; instead call os.makedirs on each so
intermediate steps are made automatically. Along the way,
the print about making a directory that already existed vanishes.
Tests which did os.path.join on directory pieces when calling
file_fixture no longer do so, since file_fixture (and dir_fixture)
do joining on an arg which is a list of paths like many other scons
functions.
The testing doc was updated to fix some wording and reflect
the above changes.
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>
|
| |
|
|
|
|
| |
In Python3 this is the default.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
sider spotted a cut-n-paste error introduced in the PR
(srcdir set instead of srcfile)
framework doc now uses directory consistently (over folder,
which is a desktop concept rather than a filesystem concept)
tweaked wording a bit more
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dir-fixture() did not concatenate a source list into a path
as the testing doc says it should. fix-fixture() did not either,
and the doc didn't say so; now it does (docstring and external
testing doc).
There was a way to slip through both dir_fixtures and file_fixture
with the path invalid - if you have fixture dirs defined,
and the dir/file is not found in them, you'll come out of the
loop set to the last fixture dir and not try the current dir.
This doesn't break anything, just leads to a somewhat misleading
message if the fixture really isn't found - the traceback indicates
the fixture was not found in whatever the last passed-in fixture
dir was. Now it looks like it was not found in the source testing dir.
The message can still be improved to be more descriptive.
A couple of minor Py2 removals.
Testing doc didn't mention FIXTURE_DIRS, so this was added.
A bunch of other doc fiddling.
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>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Drop unneeded parens.
Drop trailing semicolons.
Triple double-quote docstrings.
Regexes drop unneeded escapes.
Spaces around parens, braces: remove/add.
Some one-tuples get their missing closing comma.
A couple of sets use set init syntax {foo} instead of set([iter]) now.
And a fiddle in Node to reduce lookup time on md5 signature functions
(came about because of a line-too-long issue, initially)
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
checker-suggested fixes:
Mostly, fix remaining instances of comparing none without "is"
Some trailing whitespace on lines
A couple of instances of list init followed immediately by
several appends, turned into a single list init
Some double comparisons turned into a single expression
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
| |
framework.
In order to make the test work, it was necessary to handle the
encoding issue also in the test framework.
Otherwise, though the Latex builder can handle the case, the test
framework chokes on it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the companion to PR #3382. The testing/harness/TestCmdTests.py
unit tests do not currently pass. Note they are not run by the CI
system, or in fact by doing runtests -a, since they're in a directory
that is not searched. After these changes, there are no fails. This is
a test-only change.
The method simple_diff, modeled on difflib functions, is converted to
a generator to match difflib, and now has a doctest as well. This
means calls to it which aren't going to iterate needs to convert the
return with list(), but that just makes usage more consistent, since
the calls to difflib.context_diff and difflib.unified_diff already had
to do so.
Also, the methods that used Google-style docbook markup are changed to
REsT-style markup. Our current doc producer, epydoc, does not understand
the Google style, and we shouldn't mix styles; can convert them all in
bulk later if we switch to Sphinx as the production tool.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
| |
Also improve exception handling message in test.subdir()
|
| |\
| |
| | |
Fix Issue #3135 - Type Bound procedures in Fortran submodules
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Several locations with simple usage of deprecated "imp" module
changed to use "importlib". These match with work in #3159,
but this is not a complete implementation of #3159.
More regex patterns are changed to be raw strings.
Some strings which did not seem appropriate to change to raw
strings (e.g. contain embedded tabs, which Python should honor)
had backslashes escaped to avoid accidental Python interpretation.
Example:
'\t<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />\n'
Python 3.8 was Warning \M was an unknown escape.
More open().write(), open().read() style usage changed to use
context managers so the file is closed.
WIP part: even with Python 3.7, the tests which call sconsign.py
fail; oddly they do not fail without the patch to compat.py.
sconsign.py does an import using imp module (which is what
generates the errors) so needs to be updated anyway. It does not
quite fit the "simple usage" pattern - can't do a simple relative
import since sconsign is normally located elsewhere in the tree than
the main scons code body.
With this version of the patch, 700 tests now pass with 3.8, and
Warning messages reduced to 2800 (current master has 200 pass,
9000 warns)
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
| |
With runtest now honoring the -j 2 option given to it in
CI setup on Windows, there were some problems where scons-time
tests could try to remove a test directory while some files
in it were still open (these locations were complained about
by Python 3.8 also).
Switch test framework to using mkdtemp also, and to not use
tempfile.template (usage of that and mktemp are long
deprecated)
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
| |
In a few places, "is" and "is not" are used to compare with
a string or integer literal. Python 3.8 flags these with
a SyntaxWarning. Changed to == and !=
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
| |
|
|
| |
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
| |
A few tests blew up with exceptions (AttributeError, IndexError) if no
compiler is installed on Windows - from where they are it could possibly
happen on other platforms as well.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
class TestCmd method read() uses a shortcut to return data from
a file, "return open(...).read()". Python 3 warns this is a
resource leak because the file has no chance to be closed with
the open being in the return statement. Split into two lines
and use a context manager (with statement).
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| | |
|
|
|
quite some time
|