summaryrefslogtreecommitdiffstats
path: root/testing/framework/TestSCons.py
Commit message (Collapse)AuthorAgeFilesLines
* post release updatesWilliam Deegan2023-11-201-1/+1
|
* "Modernize" to Python 3.6 via toolMats Wichmann2023-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | $ 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>
* Add some cheap return and parameter annotationsMats Wichmann2023-05-011-37/+37
| | | | | | | | | | | | | | | | | 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>
* Updates post 4.5.2 releaseWilliam Deegan2023-03-211-1/+1
|
* Post release changesWilliam Deegan2023-03-071-1/+1
|
* Post release UpdatesWilliam Deegan2023-03-051-1/+1
|
* moved the qt tool to qt3. Changed all QT envvars to be now prefixed with QT3William Deegan2023-02-241-3/+6
|
* move qt -> qt3 tool, adjust testing as wellWilliam Deegan2023-02-231-5/+5
|
* Merge remote-tracking branch 'upstream/master' into ↵William Deegan2023-01-291-82/+93
|\ | | | | | | fix_configure_marking_up_to_date
| * [ci skip] Fix remaining sider complaintsWilliam Deegan2022-11-291-8/+2
| |
| * Use f-strings in framework and framework testsMats Wichmann2022-11-241-63/+63
| | | | | | | | | | | | | | | | | | 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>
| * A few more e2e test speedupsMats Wichmann2022-11-161-0/+2
| | | | | | | | | | | | adding DefaultEnvironment calls with no tools Signed-off-by: Mats Wichmann <mats@linux.com>
| * [framewqork] use subprocess timeoutsMats Wichmann2022-08-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Post release cleanup. back to dev modeWilliam Deegan2022-07-301-1/+1
| |
| * Improvements to lex and yacc toolsMats Wichmann2022-06-301-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix for #2757, non conftest nodes involved in configure checks now get node ↵Daniel Moody2022-05-261-2/+2
|/ | | | info cleared after check.
* Skip new content-timestamp-symlink test on win32Mats Wichmann2022-05-061-1/+6
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Use super call instead of direct class callMats Wichmann2022-03-151-2/+2
| | | | | | | | | - 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>
* Merge pull request #4067 from mwichmann/wintweaksWilliam Deegan2021-11-261-2/+0
|\ | | | | Fix tests to not hang on Windows with bad .py assoc
| * Fix tests to not hang on Windows with bad .py assocMats Wichmann2021-11-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | fix some issues with current version stringsWilliam Deegan2021-11-221-1/+1
|/
* Update post release changesWilliam Deegan2021-11-221-1/+1
|
* Tests pass in python 3.6 and 3.9 in LinuxJacob Cassagnol2021-11-091-0/+22
| | | | | | | | | | | | | | | 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.
* Half the failing testcases fixed.Jacob Cassagnol2021-11-011-3/+3
| | | | | | | | | | | | | | 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.
* Updated the Mac-specific Java check in test fwMats Wichmann2021-08-251-38/+56
| | | | | | | | 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>
* Post 4.2.0 merge/reset to development modeWilliam Deegan2021-08-011-3/+3
|
* Fix sider warning typo and docstring for skip_if_not_msvcMats Wichmann2021-04-131-1/+1
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Test harness add a from_fw to skip callsMats Wichmann2021-04-131-134/+143
| | | | | | | | | | | | | | | | | | 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>
* Deprecate Python 3.5.Mats Wichmann2021-03-281-1/+1
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Add timing of sconsign write if --debugMats Wichmann2021-02-081-2/+2
| | | | | | | | | | | 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>
* [ci skip] update post releaseWilliam Deegan2021-01-191-1/+1
|
* feat: Adds ZIP_OVERRIDE_TIMESTAMPDavid H2021-01-181-3/+33
|
* Add custom up_to_date for TimeSCons to handle individual SConscript timing ↵William Deegan2020-10-161-1/+26
| | | | output during null build run
* Drop some more Py2 compat thingsMats Wichmann2020-10-131-5/+2
| | | | | | | | | | | | | Change exception type in a a couple of try block to what could go wrong, Py3 would not raise UniCodeDecodeError for these cases One try-import of StringIO module sconsign does not need a decode that was claimed as compat hack Remove some sys.version_info checks Use more modern way to get Python details in test frawmework AddMethod updated and RenameFunction dropped - it had become a one-liner and had no clients other than AddMethod (never exposed as public) Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge pull request #3731 from mwichmann/warn-to-sconswarnWilliam Deegan2020-07-191-1/+1
|\ | | | | Change Warning to SConsWarning
| * [PR #3731] more adjustments to WarningsMats Wichmann2020-07-071-1/+1
| | | | | | | | | | | | | | Replace the arguments-to-WarningClass converter. Improve docstrings. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Post releaseWilliam Deegan2020-07-171-1/+1
| |
* | Post relaaseWilliam Deegan2020-07-171-1/+1
|/
* reset to development modeWilliam Deegan2020-07-041-3/+3
|
* Cleanups in tests and in frameworkMats Wichmann2020-06-141-1/+1
| | | | | | | | | | | | * 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>
* rm-py2: Remove "from __future__" from more placesMats Wichmann2020-02-201-1/+0
| | | | | | | | | | | | | | | 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>
* Improve debug output when configure test fails stdout checkWilliam Deegan2020-01-301-7/+5
|
* Updated to expected configure context temporary and generated files to match ↵William Deegan2020-01-301-23/+20
| | | | new scheme to add contents and action hash to file name to avoid mistakenly reusing the wrong temp file based on changing the order and/or number of the configure tests being run between successive runs
* updates to make tests pass on windowsWilliam Deegan2020-01-221-1/+1
|
* Updated TestSCons and test/Configure/option--config.py to work with new ↵William Deegan2020-01-221-26/+188
| | | | configure temporary file naming via content and action hash
* PEP8William Deegan2020-01-211-142/+148
|
* syntax fixups suggested by PyCharmMats Wichmann2019-12-231-1/+1
| | | | | | | | | | | | | | 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>
* Update version stringsWilliam Deegan2019-12-171-1/+1
|
* Changes for 3.1.1 release3.1.1William Deegan2019-08-081-1/+1
|
* changes for release 3.1.0William Deegan2019-07-211-1/+1
|