summaryrefslogtreecommitdiff
path: root/unittests/rewritetests.py
AgeCommit message (Collapse)Author
2025-11-23Condense directory names for rc1.Jussi Pakkanen
2025-11-21rewrite: fix duplicate objects for predefined globalsPaolo Bonzini
Global objects are treated as UnknownValue(), but unlike other variables their object is created on every call to get_cur_value_if_defined() instead of coming from a dictionary. This causes the dataflow DAG to have multiple objects from the same object. Fix this by building the UnknownValues at interpreter construction time. Fixes: #15261 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-18rewriter: fix kwargs info for dict-valued kwargsBenjamin Gilbert
We can't modify dict-valued kwargs (#14739) but this lets us at least read them.
2025-11-18rewriter: support project(license_files: )Benjamin Gilbert
2025-08-11Condense test directory names.Jussi Pakkanen
2025-08-01Condense test directory names for 1.9.Jussi Pakkanen
2025-06-09AstInterpreter: Fix dead-code-crashVolker Weißmann
Without this commit, the rewriter and the static introspection tool crash if `meson.build` contains something like ```meson if false foo = not_defined endif ``` or ```meson if false message(not_defined) endif ``` While it could be argued, that you should not write stuff like this, this used to raise a `MesonBugException`, which we have to fix. Fixes #14667
2025-05-29rewriter: Rewrite how we add/remove source filesVolker Weißmann
Change the semantics of IntrospectionBuildTarget.source_nodes and IntrospectionBuildTarget.extra_files . The rewriter and the static introspection tool used to be very broken, now it is *less* broken, hence we add some tests in this commit. Fixes #11763
2025-05-29Add AstInterpreter.dataflow_dagVolker Weißmann
Make the AstInterpreter create a directed acyclic graph (called `dataflow_dag`) that stores the how the data flowes from one node in the AST to another. Add `AstInterpreter.node_to_runtime_value` which uses `dataflow_dag` to find what value a variable at runtime will have. We don't use dataflow_dag or node_to_runtime_value anywhere yet, but it will prove useful in future commits.
2025-05-29rewritetests.py: Ignore order of listed sourcesVolker Weißmann
The order in which the rewriter outputs the listed sources is more or less arbitrary anyways, so we ignore it to prevent the tests from breaking after small irrelevant changes.
2025-04-14Condense directory names for 1.8 rc1.Jussi Pakkanen
2025-04-08coredata: delete set_default_optionsDylan Baker
This was only being used by the introspection interpreter, which meant the two interpreters had different behavior. They still do, which is really bad because the IntrospectionInterpreter doesn't have the command line options or project_default_options. I have a plan to fix that later, and I don't want to spend time on it here, as it's not a regression of this patch, it's just the status quo. This also fixes an issue caused by dead code being left, and hit, due to the option refactor branch. Fixes: #14382
2025-04-08tests: Add a rewriter test that handles prefixDylan Baker
"prefix" has a lot of special handling that has to go on because so many other options depend on prefix. It was also regressed by the option refactor changes, so having a test feels appropriate. This was verified against the 1.7 release, so it has the same behavior as pre-option refactor Meson.
2025-01-09Condensed directory names for release.Jussi Pakkanen
2024-09-20rewriter: don't output target info to stderrBenoit Pierre
Send the info to stdout, where it belongs.
2024-07-30unittests: fix EncodingWarnings. minus 123 warnings collected by pytestEli Schwartz
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-10-27Condense test directories for RC1.Jussi Pakkanen
2023-09-11raw printerCharles Brunet
this printer preserves all whitespaces and comments in original meson.build file. It will be useful for rewrite and potential auto-formatter
2023-04-11fix various spelling issuesJosh Soref
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-01-30unittests: Fix warning about distutils deprecationNirbheek Chauhan
unittests/rewritetests.py:19: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.dir_util import copy_tree
2022-01-10condense linesEli Schwartz
2022-01-10pyupgrade --py37-plusEli Schwartz
2021-12-15rewriter: create {add,rm}_extra_files commandsCeleste Wouters
Add ability to mutate a target's `extra_files` list through the rewriter. The logic is copied from sources add/rm, but changes the `extra_files` kwarg instead of the sources positional argument. Has additional logic to handle creating the `extra_files` list if it doesn't exist.
2021-08-15editorconfig: add setting to trim trailing whitespaceEli Schwartz
and clean up all outstanding issues Skip 'test cases/common/141 special characters/meson.build' since it intentionally uses trailing newlines.
2021-07-26Split run_unittests.py fileXavier Claessens