summaryrefslogtreecommitdiff
path: root/run_project_tests.py
AgeCommit message (Collapse)Author
2025-11-19compilers: Remove Environment parameter from Compiler.sanity_checkDylan Baker
2025-10-29Add snippets.symbol_visibility_header() methodXavier Claessens
Defining public API in a cross platform library is painful, especially on Windows. Since every library have to define pretty much the same macros, better do it in Meson.
2025-09-25mypy: enable allow-redefinition-new and fix falloutEli Schwartz
Reduces 3 errors that show up in newer mypy versions than pinned in CI. It is new since 1.16 and a likely future default for mypy 2.0. It allows things like: ``` for i in ['one', 'two', 'three']: frob_a(i) for i in [1, 2, 3]: frob_b(i) ``` since "i" is obviously used as a loop holder and its type can be freely reinvented. Note: allow-redefinition-new isn't actually about this at all, it has greater scope than loop holders and allows redefining "unannotated variables" of all kinds. No granularity in what to accept redefinition of. :P To enable this, we must also opt in to local-partial-types, which has some overlap with None-safety. Specifically: > the most common cases for partial types are variables initialized > using None, but without explicit X | None annotations. By default, mypy > won’t check partial types spanning module top level or class top level. > This flag changes the behavior to only allow partial types at local > level, therefore it disallows inferring variable type for None from two > assignments in different scopes. So with this, we also fix a couple of actual type errors this revealed. Where possible, stop None-initializing at all -- it's not strictly needed for global variables, anyway, and it's a coding error if it is possible to hit these variables without defining them first. Bug: https://github.com/python/mypy/issues/19280
2025-09-19pkgconfig: Fix class cached to be keyed on extra_pathsMichał Górny
Add `extra_paths` to cache keys for `PkgConfigInterface` and `PkgConfigCLI` instances, to avoid incorrectly reusing an instance with a different `extra_paths` value, see: https://github.com/mesonbuild/meson/pull/14657#discussion_r2320623799 Signed-off-by: Michał Górny <mgorny@quansight.com>
2025-05-15coredata: remove unused argumentsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-17android: Added android_exe_type kwargs to executableFlorian "sp1rit"​
By setting android_exe_type to `application`, the executable gets actually built as a shared library instead of an executable. This makes it possible to use an application within an android application process. mesonbuild#13758 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7555/
2025-01-07ninja backend: don't rebuild all tests by defaultEli Schwartz
When running `ninja all` we shouldn't build testsuite programs as these might not be wanted e.g. in order to just install the project. We do want them to be built when running `ninja test`. Since meson 0.63 we actually have a dedicated ninja alias for test dependencies -- move these from the "all" rule to the dedicated test/benchmark rules. Closes: https://github.com/mesonbuild/meson/issues/1704 Closes: https://github.com/mesonbuild/meson/issues/1949 Closes: https://github.com/mesonbuild/meson/issues/2518 Closes: https://github.com/mesonbuild/meson/issues/3662 Closes: https://github.com/mesonbuild/meson/pull/5728 Closes: https://github.com/mesonbuild/meson/pull/5867 Closes: https://github.com/mesonbuild/meson/pull/6511 Closes: https://github.com/mesonbuild/meson/pull/11317 Closes: https://github.com/mesonbuild/meson/issues/13378
2024-10-18pkgconfig: add support to override pkg-configAndoni Morales Alastruey
2024-10-14Do not run symlink setup on Windows.Jussi Pakkanen
2024-10-11Recreate Boost symlink at runtime to survive sdist. Closes: #13763.Jussi Pakkanen
2024-09-15When configuring fails in Github Actions, print folded logsEli Schwartz
A common, and challenging, issue in CI runners is debugging issues when you know the information you want to check, but it's in the log file which you don't have because remote CI machines. There are various edge cases where this is especially hard to solve, such as inside of `pip install` where the build directory with the log file is automatically cleaned up. But it's never really *easy* when you don't expect it, and the best case scenario is your iteration time gets cut in half as you hurriedly go add some `cat`s to your CI scripts. Meson can, at least sometimes, detect platforms where text can be emitted inside of "folds", which are auto-collapsed and don't obscure the general output, but when clicked will expand the logfile contents. Hook this up. We start off with a Github Actions implementation. We had some internal code used by our own project tests runner, which can be utilized. Also permit forcing it via an environment variable, in case autodetection fails and you just want to force *something*, especially when meson is called a couple layers deep inside some other tool.
2024-07-28add initial support for llvm-flangH. Vetinari
2024-07-12tests: rename poorly named function and add report argumentDylan Baker
The poorly named `print_tool_versions()` doesn't just print the tools versions, it finds them and populates a global table, without which some tests will fail. Rename the function and add a `report` argument so that calls can decide whether they want to have the printed message, because the single runner doesn't in quick mode.
2024-07-10tests: Clean up leftover files from source dirs.Jussi Pakkanen
2024-05-23Refactor option classes to their own file.Jussi Pakkanen
2024-04-14Fix builds with Ninja 12 and remove a 5 year old workaround.Jussi Pakkanen
2024-04-10Do not even submit test suites that are skipped completely.Jussi Pakkanen
2024-04-10Add a verbose output option to run_project_tests and default it to off.Jussi Pakkanen
2024-04-08meson format commandCharles Brunet
2024-03-17tests: rename skip_on_jobname to expect_skip_on_jobname and skip_on_os to ↵Christoph Reiter
expect_skip_on_os The test.json format currently has three keys related to skipping tests: * `skip_on_jobname` * `skip_on_os` * `skip_on_env` While `skip_on_env` marks the test itself as skipped, i.e. they don't get run when the conditions are met, the other two skip options are just marking the test as "expected to be skipped" if the conditions apply, i.e. they want to see `MESON_SKIP_TEST` in the output and things will fail if that doesn't happen. They don't actually skip the tests as the names imply. To make this clearer rename the keys: * `skip_on_jobname` -> `expect_skip_on_jobname` * `skip_on_os` -> `expect_skip_on_os` `skip_on_env` stays the same, since that actually skips. The docs were also confused about this, so adjust that too.
2024-03-10fix reconfigure subproject base optionsCharles Brunet
2024-03-01Fix base and compiler options not reconfigurable.Charles Brunet
Fixes #12920.
2024-02-14run_project_tests: Fix Cython compiler detectionAndrew McNulty
On Debian systems the cython compiler binary is installed as `cython3`. The current logic for detecting whether to run the Cython unit tests instead checks for `cython` or the value of the `CYTHON` environment variable, which leads to cases where the underlying Meson can correctly compile Cython code but the test harness excludes these tests from execution because it cannot find `cython3`. This commit makes the test harness use the same detection method as Meson itself. It also takes the opportunity to refactor some existing code which does the same job for Objective C and Objective C++ tests to avoid repetition.
2023-12-24run_project_tests: fix assertion that crashes if you have git worktreesEli Schwartz
git worktrees are frequently a handy tool to use. This glob pattern asserts an error if the same named directory appears more than once, which it will -- once per worktree -- but only because it is globbing the entire project root, even though it should always only exclusively care about files in `test cases/`. So just glob correctly, and then I can run the testsuite locally again.
2023-12-24project tests: handle code internally fetching the meson commandEli Schwartz
Fixes crash when running the tests and yasm is installed, but nasm is not. When printing the compilers at early startup in run_project_tests.py, we try to detect the nasm compiler, which in this case turns out to be yasm, and its exelist assumes that the meson command is set. Fixes #12662
2023-12-22tests: skip symlink creation when not supportedCharles Brunet
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-12-04run_project_tests: remove debug printDylan Baker
2023-11-07Prohibit symlinks in test data dir because they get mangled by setup.py.Jussi Pakkanen
2023-10-04Remove type comments in run_project_tests.pyTristan Partin
2023-09-13run_project_tests: support checking for symlinksArsen Arsenović
2023-09-07Fix include_directories test for relative pathCharles Brunet
- On Windows, it was not detected if include directory was an absolute path to source directory, because of the mis of path separators. - In the edgecase the include directory begins with the exact same string as the source directory, but is a different directory, it was falsely reported as an error. Fixes #12217.
2023-09-07Fix crash when installing a vala library and python sourcesXavier Claessens
Installing python sources causes the python module to call create_install_data() before Ninja backends adds extra outputs to Vala targets. Target objects are supposed to be immutable, adding outputs that late is totally wrong. Add extra vala outputs immediately, but be careful because the main output is only added later in post_init(). Luckily the base class already puts a placeholder item in self.outputs for the main filename so we can just replace self.outputs[0] instead of replacing the whole list which would contain vala outputs at that stage. This is surprisingly what SharedLibrary was already doing.
2023-09-01tests: repeat the failure reason in the detailed logsEli Schwartz
2023-09-01tests: move a couple log files into collapsed github groups where possibleEli Schwartz
2023-09-01tests: move the newline to the right place in ci includesEli Schwartz
Make sure this is generic enough to be properly usable
2023-09-01tests: sync ninja stdout/stderr instead of listing them separatelyEli Schwartz
It is fairly confusing for all the "ninja explain" to be the last thing you see, instead of the compile error.
2023-09-01tests: make summary section for project tests more like pytestEli Schwartz
Logs for failing tests come first, then the list of pass/fail.
2023-09-01tests: make run_project_tests finish off the verbose logs with a summaryEli Schwartz
List each testcase name that failed so we can see at a glance which ones they are.
2023-08-23machine file: Add @GLOBAL_SOURCE_ROOT@ and @DIRNAME@Xavier Claessens
2023-08-17tests: consolidate MESON_SKIP_TEST reporting and use it in unittestsEli Schwartz
Previously, we only reported the skip reason when running project tests.
2023-08-14Python: Add 'limited_api' kwarg to extension_moduleAndrew McNulty
This commit adds a new keyword arg to extension_module() that enables a user to target the Python Limited API, declaring the version of the limited API that they wish to target. Two new unittests have been added to test this functionality.
2023-06-26dependencies: defer importing a custom dependency until it is usedEli Schwartz
This lessens the amount of code imported at Meson startup by mapping each dependency to a dictionary entry and using a programmable import to dynamically return it. Minus 16 files and 6399 lines of code imported at startup.
2023-04-24Initial support for Metrowerks C/C++ compilerNomura
2023-04-11fix various spelling issuesJosh Soref
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04tests: make it easier to read overall results in githubEli Schwartz
Use collapsible sections for cicmds.
2023-03-20project tests: add log of the setup command being runEli Schwartz
Followup to commit 2acb6ee79e24db047800da30f5f4ac52cb9c012d.
2023-02-22remove pointless, unused typing-only import in the test runnerEli Schwartz
In the commit that originally added this import, it wasn't even used. Now the implementation is being moved, so it will fail to work. I do not know why I originally added it, but it needs to go. :)
2023-02-13tests: do not run the deprecated python3 tests unless python is python3Eli Schwartz
It's broken in e.g. pypy, but that's okay because the module is utterly deprecated, and people should use the python module instead.
2023-01-12tests: track when an entire category is skipped and be quieterEli Schwartz
There is no need to state for every single test that "preconditions were not met". And logging the skip reason for a single test is easy to read, but making every second line alternate is less so.