summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* runtest: add additional test of os.sep usageMats Wichmann2023-05-081-0/+78
| | | | | | | Make sure test lists with "foreign" separator still cause the correct discovery/usage. Signed-off-by: Mats Wichmann <mats@linux.com>
* Use pathlib in runtestMats Wichmann2023-05-0817-229/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the past, there have been some mismatches between how tests are specified and how they are found. testlist files, excludelist files and command-line specifications should be agnostic to operating system conventions. For example, typing "runtest.py foo/bar" on windows will produce paths like foo/bar\test.py, which is hard to match and painful to read, it should obviously match discovered foo\bar\test.py. Test information should be output using the native path separator for consistency. Using pathlib lets these be normalized - stored in a common format and output in the expected format. Adding this normalization of course broke some tests, which either intentionally or through omission expected some portion of a path to be UNIX-style. Specifically these five: test\runtest\baseline\fail.py test\runtest\baseline\no_result.py test\runtest\simple\fail.py test\runtest\simple\no_result.py test\runtest\simple\pass.py test\runtest\testargv.py This was fixed and a general cleanup/reformat performed on the runtest tests. Signed-off-by: Mats Wichmann <mats@linux.com>
* Minor cleanup ValidateOptions doc/code/testMats Wichmann2023-04-142-23/+51
| | | | | | | | | | | | Some nearby things in Main.py as well: - docstrings polished a bit, minor linting - move the list of predefined SConstruct file names into a constant defined at the top of the file, so it's a little less hidden, in the unlikely case of future changes. Manpage text and example revised a bit. Signed-off-by: Mats Wichmann <mats@linux.com>
* ParseConfig test fixMats Wichmann2023-03-091-1/+1
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix problem when MergeFlags adds to existing CPPDEFINESMats Wichmann2023-03-091-0/+31
| | | | | | | | | | | | | | | | | | | | | MergeFlags has a post-processing step if the *unique* flag evaluates True which loops through and removes the duplicates. This step uses slicing (for v in orig[::-1]), which fails if the item being cleaned is a deque - which CPPDEFINES can now be. It would also cause the deque to be replaced with a list. Detect this case and handle separately. Note the same post-processing step assures each modified object will be replaced - Override(parse_flags=xxx) silently counted on this so it does not end up sharing variables with the overridden env. This situation remains, and is accounted for by the patch. Unit test and e2e tests are extended to check that MergeFlags can now add correctly, and that Override leaves the variables independent, not shared. Fixes #4231 Signed-off-by: Mats Wichmann <mats@linux.com>
* fix textfile test failing (only on windows) needed to switch generated file ↵William Deegan2023-03-021-1/+2
| | | | comparison from r (text) to rb (read binary) since we now include unicode, and test logic assumes r = ascii
* test/import works on dummy qt tool nowMats Wichmann2023-03-011-3/+3
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Update PR 4305: failing stub qt toolMats Wichmann2023-03-011-12/+15
| | | | | | | | | | Proposed addition of code to cause stub qt to fail, and test/import.py to detect this situation. Unfortunately, it doesn't seem to work... needs adjustment. Doc updates to record rename version. Signed-off-by: Mats Wichmann <mats@linux.com>
* fix test/import.py for qt3 changesWilliam Deegan2023-02-241-3/+3
|
* moved the qt tool to qt3. Changed all QT envvars to be now prefixed with QT3William Deegan2023-02-2411-91/+89
|
* move qt -> qt3 tool, adjust testing as wellWilliam Deegan2023-02-2315-1/+1
|
* Merge pull request #4303 from RedwanFox/fix_textfile_encoding_issueWilliam Deegan2023-02-202-2/+4
|\ | | | | set default encoding of written files to UTF-8, added ability to pass custom file encoding
| * Updated docs to indicate FILE_ENCODING will affect Substfile() as well as ↵William Deegan2023-02-181-1/+2
| | | | | | | | TextFile(). Added blurb to RELEASE.txt. Updated test fixture to include new utf-8 text for test
| * set default encoding of written files to UTF-8, added ability to passNickolai Korshunov2023-02-181-1/+2
| | | | | | | | custom file enconding
* | Merge pull request #4263 from mwichmann/maint/CPPDEFINES-AppendWilliam Deegan2023-02-189-224/+966
|\ \ | | | | | | Split out CPPDEFINES handling in Append methods
| * | CPPDEFINES prepend test fixMats Wichmann2023-02-151-1/+1
| | | | | | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
| * | Tweak Append/Prepend e2e testsMats Wichmann2023-02-152-11/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added another try block so complete prepend e2e test can be run on a branch where PR #4263 is not applied (for comparison). Added license header. Changed invalid-tuple unittest to use assertRaises (behavior is the same) Also added a versionadded and a versionchanged to docstrings. Signed-off-by: Mats Wichmann <mats@linux.com>
| * | Added DefaultEnvironment(tools=[]) to fixtures for CPPDEFINES. Added ↵William Deegan2023-02-102-0/+3
| | | | | | | | | | | | negative test for non-two-tuple. Minor wording change
| * | Adjust CPPDEFINES tests to be more resilientMats Wichmann2023-02-102-20/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | In a hope to make the tests runnable against a checkout that does not include PR #4263, add some try blocks so the things which used to blow up can generate errors rather than aborting the test run. The prepend test still fails against master. Signed-off-by: Mats Wichmann <mats@linux.com>
| * | Adjusted CPPDEFINES behavior for list and tupleMats Wichmann2023-02-094-213/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the previous proposals, addition of a bare tuple is restored to the valued-macro behavior (this previously did not work consistently). Strings are now consistently split if they contain spaces, except if entered as a list member, in which case (as documented) they are left alone. tuples with nore than two members are now flagged as a UserError; previously the first two members were taken as name=value and any further members were silently ignored. More tests added. Signed-off-by: Mats Wichmann <mats@linux.com>
| * | Fix some CPPDEFINES handling problemsMats Wichmann2023-01-304-0/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few places were deciding what to do based on result of is_List, when the intent was really list-or-tuple-or-derivatives - changed to is_Sequence. Added some test cases, including a unit test for processDefines (which would have caught one of these cases). Signed-off-by: Mats Wichmann <mats@linux.com>
| * | test/CPPDEFINES: stop using tabsMats Wichmann2023-01-304-204/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | The test output for append and prepend generated tabs, and so the "expected" strings had to contain tab indents. This made Sider on the CI extremely noisy. There's no specific benefit to tabs here, so just change them to spaces. Signed-off-by: Mats Wichmann <mats@linux.com>
| * | Split out CPPDEFINES handling in Append methodsMats Wichmann2023-01-309-181/+673
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than having lots of special-case code for CPPDEFINES in four separate routines, add a new _add_cppdefines function to handle it, paying attention to append/prepend, unique/duplicating, and keep-original/replace-original. The existing special case handing was then removed from Append and AppendUnique (it was never present in Prepend and PrependUnique anyway - see #3876, but these now get it due to a call to the new function). Tuple handling is now consistent with list handling: a single tuple is treated as macro names to add, not as a name=value pair. A tuple or list has to be a member of a containing tuple or list to get the macro=value treatment. This *may* affect some existing usage. macro=value tuples without a value can now be entered either in (macro,) form or (macro, None) form. Internally, whenever append/prepend is done, existing contents are forced to a deque, which allows efficient adding at either end without resorting to the tricks the Prepend functions currently do (they still do these tricks, but only in non-CPPDEFINES cases). As a result, values from a dict are not stored as a dict, which has some effect on ordering: values will be *consistently* ordered, but the ones from the dict are no longer necessarily sorted. In SCons/Defaults.py, processDefines no longer sorts a dict it is passed, since Python now preserves dict order. This does not affect the E2E test for CPPDEFINES - since those all call an Append routine, CPPDEFINES will always be a deque, and so processDefines never sees a dict in that case. It could well affect real-life usage - if setup of CPPDEFINES was such that it used to contain a dict with multiple entries, the order might change (sorting would have presented the keys from that dict in alphabetical order). This would lead to a one-time rebuild for actions that change (after that it will remain consistent). In the E2E test CPPDEFINES/append.py some bits were reformatted, and the handler routine now accounts for the type being a deque - since the test does a text comparison of internally produced output, it failed if the word "deque" appeared. Some new test cases were added to also exercise strings with spaces embedded in them. Changes were made to the expected output of the E2E test. These reflect changes in the way data is now stored in CPPDEFINES, and in some cases in order. Most of these do not change the meaning (i.e. "result" changes, but "final" output is the same). These are the exceptions: - "appending a dict to a list-of-2lists", AppendUnique case: order now preserved as entered (previously took the order of the appended dict) - "appending a string to a dict", Append case: not stored as a dict, so ordering is as originally entered. - "appending a dict to a dict", Append case: no longer merge into a dict, so this is now an actual append rather than a merge of dicts which caused the uniquing effect even without calling AppendUnique (arguably the old way was incorrect). A new test/CPPDEFINES/prepend.py is added to test Prepend* cases. append.py and prepend.py are structured to fetch the SConstruct from a fixture file. append.py got an added test in the main text matrix, a string of the macro=value form. The same 5x5 maxtrix is used in the new prepend.py test as well ("expected" values for these had to be added as well). Cosmetically, append and prepend now print their test summary so strings have quotation marks - the "orig" lines in the expected output was adjusted. This change looks like: - orig = FOO, append = FOO + orig = 'FOO', append = 'FOO' The other tests in test/CPPDEFINES got copyright updating and reformatting, but otherwise do not change. Documentation updated to clarify behavior. Fixes #4254 Fixes #3876 Signed-off-by: Mats Wichmann <mats@linux.com>
* | Minor tex test fixMats Wichmann2023-02-181-2/+2
|/ | | | | | | | | | | | Syntax of selecting a glossary updated - apparently the late 2022.* texlive releases have started warning and prompting for action on this which appears to be what breaks the test. Not directly related to this test, but to trying to get a reasonable set of tests to run, added some pkgs to bin/scons_dev_master.py - this has absolutely no effect on SCons itself. Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge remote-tracking branch 'upstream/master' into ↵William Deegan2023-01-28168-2328/+4795
|\ | | | | | | fix_configure_marking_up_to_date
| * Run latex after bibtex/biber only when necessaryLukas Schrangl2023-01-232-6/+27
| | | | | | | | | | | | Although comments in src/engine/SCons/Tool/tex.py indicated that latex should only be run after biber/bibtex if the .bbl file had changed, it was always run.
| * Merge branch 'master' into maint/gfortran-fiddleWilliam Deegan2023-01-231-1/+1
| |\
| | * Add Python 3.12 supportMats Wichmann2023-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Updated one testcase which now generates a warning, failing the test (which expects no stderr). * Updated ActionTests.py to know about 3.12, and uses the current bytecode sequences (these might change later in the 3.12 cycle) * Added 3.11 and 3.12 to setup.cfg so tools which query "what Pythons does SCons support" from pypi metadata won't be fooled into thinking 3.11 isn't supported (or 3.12, though that's preliminary). Signed-off-by: Mats Wichmann <mats@linux.com>
| * | gfortran - remove some debug prints [skip appveyor]Mats Wichmann2023-01-221-6/+0
| | | | | | | | | | | | | | | | | | | | | One of the tests had some debug fluff left over - cleaned. Reworded the CHANGES blurb and added one to RELEASE. Signed-off-by: Mats Wichmann <mats@linux.com>
| * | Tweak gfortran tool to respect tool settingMats Wichmann2023-01-183-108/+96
| |/ | | | | | | | | | | | | | | | | | | If one of the Fortran compiler environment values *other than* FORTRAN is set when calling Environment, if the tool is gfortran that choice was not respected. Now uses the supplied values of, for example, F77, SHF77, F95 or SHF95. The setting of FORTRAN/SHFORTRAN was already respected. Signed-off-by: Mats Wichmann <mats@linux.com>
| * Merge pull request #4289 from mwichmann/java-emitted-cachedirWilliam Deegan2023-01-171-0/+77
| |\ | | | | | | Fix problem where Java inner classes cannot cache
| | * Remove unneeded code in new Java testMats Wichmann2023-01-131-2/+2
| | | | | | | | | | | | | | | | | | | | | java inner class cache teest: String didn't need to interpolate from locals() as there were no variables to fill in. Signed-off-by: Mats Wichmann <mats@linux.com>
| | * Fix problem where Java inner classes cannot cacheMats Wichmann2023-01-131-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generated files contained a '$' in filename and this blew up subst. Situation arose because of a need to fetch the FS entry of the source for finding permissions. Now we use the permissions of the cached target to decide whether to chmod to add write permission, this avoids the need to call File() on the source. Signed-off-by: Mats Wichmann <mats@linux.com>
| * | feat: adds JAVAPROCESSORPATH construction variable; updates JavaScanner to ↵djh2023-01-131-0/+95
| |/ | | | | | | scan JAVAPROCESSORPATH
| * Force OBJSUFFIX for TEMPFILE test to be .o so it match expected on all platformsWilliam Deegan2022-12-311-0/+1
| |
| * Simplify test for commpilation db + TEMPFILE interactionWilliam Deegan2022-12-312-60/+13
| |
| * Update copyright header text, format filesWilliam Deegan2022-12-313-6/+10
| |
| * Merge branch 'fix_4275_comp_db_with_TEMPFILE' of github.com:bdbaddog/scons ↵William Deegan2022-12-312-0/+141
| |\ | | | | | | | | | into fix_4275_comp_db_with_TEMPFILE
| | * Added specific test for Compilation Database to reproduce issue #4275 with ↵TZe2022-12-122-0/+141
| | | | | | | | | | | | TempFileMunge
| * | Fixed using --diskcheck=none from command line. It was always broken. ↵William Deegan2022-12-191-5/+12
| |/ | | | | | | SetOption('diskcheck','none') has been working all along. Also refactored the DiskChecker class to have more meaningful properties and not shadow default python objects (list, dir)..
| * Fix broken testsWilliam Deegan2022-12-043-4/+5
| |
| * Added --experimental=tm_v2 which switches to use Andrew Morrow's new ↵William Deegan2022-12-041-2/+1
| | | | | | | | ParallelJob implementation. WHich should scale much better for highly parallel builds
| * Merge branch 'master' of github.com:SCons/scons into ↵William Deegan2022-12-0338-98/+170
| |\ | | | | | | | | | add_logging_to_new_parallel_job
| | * Remove an extra check in one ninja testMats Wichmann2022-11-171-4/+2
| | | | | | | | | | | | | | | | | | | | | Caused it to unnecessarily skip the test on Windows platforms where the Python SCripts directory was not in the search path. Signed-off-by: Mats Wichmann <mats@linux.com>
| | * A few more e2e test speedupsMats Wichmann2022-11-166-5/+17
| | | | | | | | | | | | | | | | | | adding DefaultEnvironment calls with no tools Signed-off-by: Mats Wichmann <mats@linux.com>
| | * Speed up a few tests for CIMats Wichmann2022-11-1530-82/+141
| | | | | | | | | | | | | | | | | | | | | | | | A collection of tests known to be among the slower ones to run on Windows got the addition of DefaultEnvironment(tools=[]) calls in an attempt to speed things up a bit. The is no test strategy change. Signed-off-by: Mats Wichmann <mats@linux.com>
| | * Move execution environment sanitation from Action._suproc to ↵William Deegan2022-11-021-0/+6
| | | | | | | | | | | | SCons.Util.sanitize_shell_env(ENV). Have ninja's spawning logic use this same function to clean it's execution environment
| | * Merge pull request #4251 from bdbaddog/taskmaster_trace_to_python_loggingWilliam Deegan2022-10-262-13/+7
| | |\ | | | | | | | | Fixed taskmaster trace tests.
| | | * Fixed taskmaster trace tests. Previously there was an extra line at the end ↵William Deegan2022-10-262-13/+7
| | | | | | | | | | | | | | | | 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
| * | | Added TestCommon.must_match_file() function. Updated test for ↵William Deegan2022-12-035-172/+267
| |/ / | | | | | | | | | --taskmastertracefor (NewParallel/LegacyParallel Jobs). Now uses golden files to compare expected output and output files