summaryrefslogtreecommitdiffstats
path: root/testing
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4183 from mwichmann/maint/lex_yaccWilliam Deegan2022-07-191-9/+24
|\ | | | | Improvements to lex and yacc tools
| * 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>
* | [Test] drop old exception msgsMats Wichmann2022-07-081-1/+1
|/ | | | | | | | | Minor maintenance to drop a regex group in a few tests (including in a test framework test) which allowed for two different exception messages: one belongs to very old Pythons which are no longer supported by SCons. Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge pull request #4170 from dmoody256/ninja_exit_daemonWilliam Deegan2022-06-141-0/+38
|\ | | | | [NINJA] Added new alias 'shutdown-ninja-scons-daemon' to allow ninja to shutdown the daemon
| * fix issue when deleting cleaning up deamonDaniel Moody2022-06-141-1/+1
| |
| * Fixed some typos. Added skip_test() if psutil is not present for new test. ↵William Deegan2022-06-141-0/+6
| | | | | | | | Added note to CHANGES.txt/RELEASE.txt that psutil is required for the new test for this function
| * Merge branch 'master' into ninja_exit_daemonWilliam Deegan2022-06-142-66/+16
| |\
| * | install psutil for testing and fix sider complaintsDaniel Moody2022-06-071-1/+1
| | |
| * | Added new alias 'shutdown-ninja-scons-daemon' to allow ninja to shutdown the ↵Daniel Moody2022-06-071-0/+32
| | | | | | | | | | | | daemon
* | | Test Framework tests: Windows fixesMats Wichmann2022-06-142-62/+62
| |/ |/| | | | | | | | | | | | | Where string pasting is done using test or interpreter paths, make sure they're pasted as raw strings to avoid problems on the Windows platform, where the likely presence of '\Users` is likely to cause a unicode error. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Fix sider complaintsWilliam Deegan2022-06-131-1/+1
| |
* | Added test for test.run()'s arguments set to a dict which will expand into ↵William Deegan2022-06-132-66/+16
|/ | | | KEY=VAL for each item in that dict. Also changed to unittest.main() form TestSuite()
* If no newline at end of message supplied to skip_test(), then we write one ↵William Deegan2022-06-031-0/+2
| | | | to stdout after the original message
* Merge branch 'master' into 4162-python-311-unittestsMats Wichmann2022-05-301-1/+6
|\
| * Skip new content-timestamp-symlink test on win32Mats Wichmann2022-05-061-1/+6
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* | Fix some Py 3.11 depr warns in testsMats Wichmann2022-05-302-4/+8
|/ | | | | | | | | A couple of unittest methods that a few SCons tests use have been marked deprecated in Python 3.11, with replacements provided. Partial fix for #4162, do not close just off this PR. Signed-off-by: Mats Wichmann <mats@linux.com>
* test framework: fix exception on timeoutMats Wichmann2022-04-051-5/+9
| | | | | | | | | | If the framework wait_for() method actually times out, it tries to return stdout and stderr by calling the framework methods of those names. The stdout() method was protected against the message not having been captured (as is the case on timeout). Updated the stderr() method to use the same technique. Signed-off-by: Mats Wichmann <mats@linux.com>
* Use super call instead of direct class callMats Wichmann2022-03-156-13/+13
| | | | | | | | | - 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-263-12/+2
|\ | | | | Fix tests to not hang on Windows with bad .py assoc
| * Fix tests to not hang on Windows with bad .py assocMats Wichmann2021-11-263-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add support for Visual Studio 2022Joseph Brill2021-09-231-1/+4
|
* 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
|
* Merge branch 'master' into ninja-generationWilliam Deegan2021-05-241-4/+0
|\
| * Test tweaks to help testing on mingw-only win32 systemsMats Wichmann2021-04-141-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix ninja tool rules for macos/ar for static libs to skip response files ↵William Deegan2021-04-131-0/+1
|/ | | | for now. Also fix build_libraries to have proper shlib suffix
* 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-139-265/+389
| | | | | | | | | | | | | | | | | | 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>
* fix sider issuesDaniel Moody2021-04-051-1/+0
|
* improved DoubleCacheDir test, added extra cachedir validation check.Daniel Moody2021-04-051-3/+31
|
* 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-082-6/+6
| | | | | | | | | | | 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
* One more "drop py2"ism from test frameworkMats Wichmann2020-10-131-3/+3
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Drop some more Py2 compat thingsMats Wichmann2020-10-132-7/+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>
* Run autoflake on codeMats Wichmann2020-09-215-7/+0
| | | | | | | | | | 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>
* 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
|
* A few more edits to testing docMats Wichmann2020-06-251-9/+8
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Some updates to testing doc. [ci skip]Mats Wichmann2020-06-221-18/+41
| | | | | | Maybe this shouldn't be in git after all? Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge pull request #3706 from dirkbaechle/issue3580-generate-doc-lxmlWilliam Deegan2020-06-214-7/+73
|\ | | | | Update of the documentation toolchain to work properly under Python3