summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Exp: try to make the Windows Docbook tests betterMats Wichmann2025-03-1217-17/+34
| | | | | | | | | | | | | | Try to fix Windows fails on Docbook tests in case xsltproc is found. On both GitHub Actions and AppVeyor, it's found as part of StrawberryPerl, which is part of the default install. Intermittent fails seem caused by network issues (whether actual problems, or forced revectoring to https not supported by xsltproc according to some internet issue reports), so propagate two xsltproc flags for this that were in three of the "live" (named "cmd" here) tests, but not the others. Also made other parts of the setup of these tests more consistent (passing found xsltproc wasn't done) Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix typos in CCFLAGS testMats Wichmann2025-03-061-4/+3
| | | | | | tool=[] -> tools=[] Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix small problem in a yacc testMats Wichmann2025-02-171-2/+1
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge pull request #4676 from rdbisme/extra-libsWilliam Deegan2025-02-1510-0/+175
|\ | | | | :bug: Allow passing `extra_libs` to `CheckLibWithHeader`
| * Add note to docstring that this is a live test per mwichmannWilliam Deegan2025-02-151-0/+2
| |
| * SimplifyWilliam Deegan2025-02-151-2/+0
| |
| * Simplify use of dir_fixtureWilliam Deegan2025-02-151-1/+1
| |
| * Simplify use of dir_fixtureWilliam Deegan2025-02-151-2/+0
| |
| * Simplify use of dir_fixture and some test logic. Added ↵William Deegan2025-02-152-11/+4
| | | | | | | | DefaultEnvironment(tools=[]) to speed up on windows
| * Per request, "fixture-ize" CheckLibWithHeader_extra_libs testMats Wichmann2025-02-1310-120/+125
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
| * Windows-ify the new CheckLibWithHeader testMats Wichmann2025-02-091-15/+67
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
| * Fix CheckLibWithHeader test - undo mistakeMats Wichmann2025-02-081-2/+0
| | | | | | | | | | | | | | | | "Muscle memory" had me add calls to skip tools for DefaultEnvironment, but the two library builds use it, so that was just plain wrong. Restored prior state. Signed-off-by: Mats Wichmann <mats@linux.com>
| * Minor fixes to CheckLibWithHeader testMats Wichmann2025-02-081-8/+43
| | | | | | | | | | | | | | | | Add boilderplate header/footer, fix one place where the wrong (non-portable) name for a library was used. Still does not build on Windows, due to mismatch between .dll/.lib construction. Signed-off-by: Mats Wichmann <mats@linux.com>
| * Also enable extra_libs for CheckLibMats Wichmann2025-02-071-3/+3
| | | | | | | | | | | | Manpage entries and docstrings updated with version-added specifiers. Signed-off-by: Mats Wichmann <mats@linux.com>
| * :white_check_mark: Add testRuben Di Battista2025-01-261-0/+94
| |
* | Handle --debug containing memoizerMats Wichmann2025-02-031-26/+22
|/ | | | | | | | | | | The memoizer statistics have to be handled specially as they use conditional decorators, those have to be enabled before any of the decorated methods are read by Python. This worked if there was exactly "--debug=memoizer" on the commandline or in SCONSFLAGS, but not if it was in a multi-value option like "--debug=presub,memoizer". Handle the up-front-check a little more completely to fix this. Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix Issue #2281, post and pre actions were being ignored when added to an ↵William Deegan2025-01-201-0/+16
| | | | Alias() node, if there was no action specified when that node was created
* Fixed mis-match between code and manpage for Help()'s local_only argument. ↵William Deegan2024-12-222-59/+30
| | | | Now code matches the documentation. Additionally fixturized the Help test
* Fixed mis-match between code and manpage for Help()'s local_only argument. ↵William Deegan2024-12-221-0/+0
| | | | Now code matches the documentation. Additionally fixturized the Help test
* Merge branch 'master' into maint/st_modeWilliam Deegan2024-12-161-2/+15
|\
| * Change update-release-info test for Python changesMats Wichmann2024-12-151-2/+15
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* | Adjust sconsign tests for float timestampsMats Wichmann2024-12-155-193/+193
| | | | | | | | | | | | | | | | | | If a stat_result object's st_*time attributes are used, a float is returned instead of an int. Adjust sconsign test regexes to optionally accept a .digits tail of the number. Confirmed this works for both indexed attributes (which return an int) and named attributes (float). Signed-off-by: Mats Wichmann <mats@linux.com>
* | Modernize stat usageMats Wichmann2024-12-1513-82/+83
|/ | | | | | | | | | | Since Python 2.2, the object returned by an os.stat() call presents attributes matching the 10-tuple of stat values. Use these instead of indexing into the tuple. As usual for non-removed tests, minor tweaks made if needed - copyright header and DefautlEnvironment() call for performance. Signed-off-by: Mats Wichmann <mats@linux.com>
* updated so TestSCons.NINJA_BINARY is set and used by all such testsWilliam Deegan2024-11-2522-25/+22
|
* Fixed ninja binary location logic to use ninja.BIN_DIR. Previous logic no ↵William Deegan2024-11-2522-111/+25
| | | | longer works starting with python ninja package version 1.11.1.2
* Integrate `from __future__ import annotations`Thaddeus Crews2024-11-161-2/+3
|
* Merge branch 'master' into jbrill-msvs-testsJoseph Brill2024-10-2819-43/+49
|\ | | | | | | Manually resolve conflicts in CHANGES.txt.
| * Add a tag to the cachedirMats Wichmann2024-10-2817-27/+29
| | | | | | | | | | | | | | | | | | | | | | Since there are now two files to make when a cachedir is created, use the temporary-dir -> rename technique. CacheDir tests no longer pre-create the cache directory, they should be verifying it's created properly upon request (one unit test still makes sure passing an existing empty directory works, too). Signed-off-by: Mats Wichmann <mats@linux.com>
| * Move IS_ROOT definition to frameworkMats Wichmann2024-10-192-8/+2
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
| * Fix indent problem in Install test fixMats Wichmann2024-10-191-3/+2
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
| * Adjust tests in case running as rootMats Wichmann2024-10-192-13/+24
| | | | | | | | | | | | | | | | | | | | | | Although validation tests are not normally run as root, there may be cicrumstances when it happens - one known case is when the test suite is run as part of a particular Linux distros package construction. It isn't too hard to avoid the few places where we counted on something failing because of permissions, which don't if the user is root - added a few skips. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Add optional keyword argument auto_filter_projects to MSVSSolution.Joseph Brill2024-10-284-411/+487
| | | | | | | | | | | | | | Changes: * Detect solution file names and nodes in projects argument list. Behavior based on the auto_filter_projects value. By default, raise an exception. * Update TestSConsMSVS and multiple project auto_build_solution tests. * Update documentation, CHANGES.txt, and RELEASE.txt.
* | Merge branch 'master' into jbrill-msvs-testsJoseph Brill2024-10-201-27/+24
|\ \ | |/
| * Fix nasm test [skip appveyor]Mats Wichmann2024-10-061-27/+24
| | | | | | | | | | | | | | Fix reported problem of missing header (no declaration for exit()). Clean up to current styles. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Remove win32 platform specification (i.e., platform = 'win32') from MSVS ↵Joseph Brill2024-10-199-17/+24
| | | | | | | | test Environments.
* | Remove MSVSProject argument projectguid and replace with MSVS_PROJECT_GUID ↵Joseph Brill2024-10-1310-10/+10
| | | | | | | | in all test files.
* | Update MSVS new test file headers based on the template test file header. ↵Joseph Brill2024-10-126-24/+18
| | | | | | | | [ci skip]
* | Update Tool/msvs.py, update MSVS tests; and add additional tests for MSVS ↵Joseph Brill2024-10-1121-47/+952
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multi-project and solution builds. Tool/msvs.py: * Add "projectguid" argument to MSVSProject to enable user-defined GUID assignment per-project for multiple project solutions. * Project GUID priority: (1) MSVSProject "projectguid" argument, (2) SCons env MSVS_PROJECT_GUID value, (3) internally generated GUID. SCons env MSVS_PROJECT_GUID value should not be used for multiple project solutions without using projectguid arguments (otherwise, multiple projects will use the same GUID). * Store the project GUID as a node Tag when generating the MSVSProject and retrieve the project GUIDs using GetTag when generating the solution. * Move project node processing to a function so it can be called from multiple code locations. * Filter out solution nodes from project list (bugfix: auto_build_solution enabled and returned value used as project list includes auto-generated solution as a Project in the solution file). * Check for variant directory build of MSVSSolution and adjust src node accordingly similar to MSVSProject code. Bug fix: the solution file is generated in the build directory instead of the source directory. The placeholder solution file is now generated in the build directory and the solution file is generated in the source folder similar to the handling of project files. * Add project dsp nodes to the dsw source node list. This appears to always cause the project files to be generated before the solution files which is necessary to retrieve the project GUIDs for use in the solution file. This does change the behavior of clean for a project generated with auto_build_solution disabled and explicit solution generation: when the solution file is cleaned, the project files are also cleaned. The tests for vs 6.0-7.1 were changed accordingly. testing/framework/TestSConsMSVS.py: * Add known project GUID for single project tests and two known project GUIDs for dual project tests. * Add projectguid to MSVSProject arguments for single project test SConstruct/SConscript files. * Add PROJECT_BASENAME replaceable field to expected generated project file templates. * Add dual project and single solution templates. Tests: * Use known project guid for most tests which prevents have to hard-code generated GUIDs. * Add 4 (2x2) tests using two projects for combinations of auto_build_solutions settings (2) and variant directories (2). * Add 2 tests using two projects which use default GUID generation with and without variant directories.
* | Add safe HOST_ARCH to sconstruct/sconscript environment for MSVS test scripts.Joseph Brill2024-10-086-12/+30
| | | | | | | | | | | | | | | | | | | | Scripts affected: * /test/MSVS/vs-7.0-scc-files.py * /test/MSVS/vs-7.0-scc-legacy-files.py * /test/MSVS/vs-7.1-scc-files.py * /test/MSVS/vs-7.1-scc-legacy-files.py * /test/MSVS/vs-scc-files.py * /test/MSVS/vs-scc-legacy-files.py
* | Merge branch 'Master' into jbrill-msvs-testsJoseph Brill2024-10-072-5/+6
|\ \ | |/
| * Fix short-option processingMats Wichmann2024-09-162-5/+6
| | | | | | | | | | | | | | | | | | | | Override the _process_short_opts method from optparse so it behaves better. This fix is lifted directly from #3799, leaving an additional part to apply later. Fixes #3798 Signed-off-by: Mats Wichmann <mats@linux.com>
* | Fix MSVS tests and minor changes to Tool/msvs.py.Joseph Brill2024-10-0716-112/+60
|/ | | | | | | | | | | | | | | | | | | | | | | | testing/framework/TestSConsMSVS.py: * Add default project GUID * Pass MSVS_PROJECT_GUID via environment * Add AdditionalOptions Condition to expected vcx project file * Fix vs version number for vc version 14.3 * Fix expected platform toolset version SCons/Tool/msvs.py: * User environment MSVS_PROJECT_GUID when creating project files info * Fix writing Visual Studio 15 for VS2015 * Add .vcxprof as an expected suffix for assigning the name to the file base name Fix early exit after vc version 8.0 (exit at the end of first loop execution) in: * test/MSVS/vs-files.py * test/MSVS/vs-scc-files.py * test/MSVS/vs-scc-legacy-files.py * test/MSVS/vs-variant_dir.py Tests: * Modify tests using TestSConsMSVS to add MSVS_PROJECT_GUID to the environment in the generated SConstruct/SConscript files. * Fix: delete env['PYTHON_ROOT'] before next loop iteration in test/MSVS/vs-files.py.
* Merge branch 'master' into AddOption-option-objWilliam Deegan2024-09-162-2/+2
|\
| * Update docs and usage of TEMPFILE/TempFileMungeMats Wichmann2024-09-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tempfiles are now cleaned up via registering a cleanups with atexit(), instead of trying to squeeze removing the file into the command line. On Windows that caused the file to get deleted too early (did not work well with interactive mode), and on Linux it didn't remove the file at all. The Platform test expected to be able to read the tempfilename as the last argument of the "command", but this is no longer provided as the "rm filename" is no longer added, so now it has to chop off the prefix from the command-file argument to get the filename. Unrelatedly, two syntax warnings that turn up in the test output where some TeX syntax was listed in a docstring in a test are fixed by making that a raw string - got tired of seeing these. Fixes #4595 Signed-off-by: Mats Wichmann <mats@linux.com>
* | Fix some AddOption issuesMats Wichmann2024-09-111-0/+9
|/ | | | | | | | | | | | | The optparse add_option method supports an additional calling style that is not directly described in SCons docs, but is included by reference ("see the optparse documentation for details"): it takes a single arg consisting of a premade option object. Because the optparse code detects that case based on seeing zero kwargs, and we always add at least one (default=) that would fail for AddOption. Fix for consistency, but don't advertise it further: not addewd to manpage synoposis/description. Signed-off-by: Mats Wichmann <mats@linux.com>
* New PackageVariable test - enter path as rawstringMats Wichmann2024-09-041-1/+1
| | | | | | Else it fails on Windows. Signed-off-by: Mats Wichmann <mats@linux.com>
* PackageVariable now returns the default on "true"Mats Wichmann2024-09-041-6/+34
| | | | | | | | | | | | | | In all doc versions until 4.8.0, PackageVariable had wording like: "The option will support the values yes, true, on, enable or search, in which case the specified default will be used", but the code didn't actually do that, it just returned True. With this change it now returns the default value, with a slight tweak - if the default is one of the spelled out enabling strigs, it returns the boolean True instead. The indication that the default is produced if a truthy string is given is restored to the manpage (it was never dropped from the User Guide). Signed-off-by: Mats Wichmann <mats@linux.com>
* Variables testing: confirm space-containing valuesMats Wichmann2024-08-273-7/+27
| | | | | | | | | | | | | The previous commit introduced a change to how the framework handled arguments, which necessitated some changes in the variables code. It got too complicated, too many places would need too much logic. Just accept that the test.run(arguments="...") will never be quite like the same arguments on the CLI, and just use lists to avoid things being broken on embedded spaces - those won't be split. Many tests arleady do this, so it's nothing new. Added a comment in TestCmd to make it more clear. Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix ListVariable with a space-containing valueMats Wichmann2024-08-161-39/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix ListVariable handling of a quoted variable value containing spaces. As a side effect of splitting the former monolithic converter/validator for ListVariable into separate callbacks, it became possible for subst to be called twice. The ListVariable converter produces an instance of a _ListVariable container, and running subst on that result ends up losing information, so avoid doing so. While developing a test for this, it turned out the test framework also didn't handle a quoted argument containing a space, so that a test case passing arguments to scons via "run(arguments='...')" could end up with scons seeing a different (broken) command line than scons invoked with the same arguments typing to a shell prompt. A regex is now used to more accurately split the "arguments" parameter, and a unit test was added to the framework tests to validate. The framework fix had a side effect - it was possible that when run as part of the test suite, the Variables package could receive a value still wrapped in quotes, leading to string mismatches ('"with space"' is not equal to 'with space'), so ListVariable now strips wrapping quote marks. Also during testing it turned out that the earlier fix for #4241, allowing a Variable to declare the value should not be subst'd, introduced problems for two types which assumed they would always be passed a string. With subst=False, they could be passed a default value that had been specified as a bool. Fixed to not fail on that. Fixes #4585 Signed-off-by: Mats Wichmann <mats@linux.com>
* Add timeout to test/ninja/default_targets.pyMats Wichmann2024-07-162-20/+17
| | | | | | Has timed out not completing in the CI. Signed-off-by: Mats Wichmann <mats@linux.com>