summaryrefslogtreecommitdiff
path: root/unittests/linuxliketests.py
AgeCommit message (Collapse)Author
2025-12-17dependencies: Require 'native' be passed in kwargsDylan Baker
This simplifies a bunch of cases, and likely fixes some annoying bugs in cross compile situations where should have been passing this and weren't.
2025-11-23Condense directory names for rc1.Jussi Pakkanen
2025-11-19compilers: Remove Environment parameter from CLikeCompiler.gen_dynamic_link_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.find_libraryDylan Baker
2025-11-12rust: allow linking with sanitizer-enabled C librariesPaolo Bonzini
Fixes: #15222 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-11compilers: support prelinking with ClangAlois Wohlschlager
Clang supports prelinking using the same `-r` flag as GCC. There has been prior art in [1], which stalled at the time due to Clang inappropriately trying (and failing) to link libgcc_s. This issue does not occur any more with versions 14 and higher. [1] https://github.com/mesonbuild/meson/pull/8883
2025-10-06compilers: do not use coredata.set_optionsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06options: replace get_value with get_value_forPaolo Bonzini
The two methods are identical. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-29Fix Cygwin test failure.Jussi Pakkanen
2025-08-11Condense test directory names.Jussi Pakkanen
2025-08-01Condense test directory names for 1.9.Jussi Pakkanen
2025-07-10unittests: add test for c_link_args and CFLAGS interactionPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-05-15unittests: add test for CFLAGS in linker command linePaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-24interpreter: do not use pathlib for DependencyVariableString creationPaolo Bonzini
Path.is_dir() can raise a PermissionError if a parent does not have the executable permission set; plus the "in p.parents" tests are very expensive. Do not use Path at all. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-14Condense directory names for 1.8 rc1.Jussi Pakkanen
2025-03-21CI: Fix filemode tests with cygwin 3.6.0Jon Turney
Put cygwin filemode tests back under the sourcedir Remove inheritable permissions from the sourcedir For :reasons:, the unit tests which check file mode were built in the tempdir. Instead, remove inheritable permissions from the working directory (which the GitHub VM image has set for some reaons), since they can interfere with getting exactly the file mode you asked for. Partially reverts 04ae1cfb7999e25f476f84572ff0ad853629346c
2025-03-09compilers: convert `b_sanitize` to a free-form array optionPatrick Steinhardt
In the preceding commit we have started to perform compiler checks for the value of `b_sanitize`, which allows us to detect sanitizers that aren't supported by the compiler toolchain. But we haven't yet loosened the option itself to accept arbitrary values, so until now it's still only possible to pass sanitizer combinations known by Meson, which is quite restrictive. Lift that restriction by adapting the `b_sanitize` option to become a free-form array. Like this, users can pass whatever combination of comma-separated sanitizers to Meson, which will then figure out whether that combination is supported via the compiler checks. This lifts a couple of restrictions and makes the supporting infrastructure way more future proof. A couple of notes regarding backwards compatibility: - All previous values of `b_sanitize` will remain valid as the syntax for free-form array values and valid combo choices is the same. We also treat 'none' specially so that we know to convert it into an empty array. - Even though the option has been converted into a free-form array, callers of `get_option('b_sanitize')` continue to get a string as value. We may eventually want to introduce a kwarg to alter this behaviour, but for now it is expected to be good enough for most use cases. Fixes #8283 Fixes #7761 Fixes #5154 Fixes #1582 Co-authored-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Patrick Steinhardt <ps@pks.im>
2025-03-06unittests: Use more subtestsDylan Baker
2025-02-13Make all Meson level options overridable per subproject.Jussi Pakkanen
2025-01-09Condensed directory names for release.Jussi Pakkanen
2024-12-16Handle top level options set in subprojects. Closes #13847.Jussi Pakkanen
2024-10-23pkgconfig: fix use of uninstalled librariesAndoni Morales Alastruey
Prepend the path of uninstalled libraries to PKG_CONFIG_PATH so they have preference over other search paths set by the user. see: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3247
2024-10-20Condense test directories.Jussi Pakkanen
2024-09-24qt module: allow has_tools to specify which tools to checkPierre Lamot
This allows checking for tools that may not be available in older version of qt or avoiding requesting tools that may not be necessary for a given project Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
2024-08-26compilers: Allow prelinking with Apple ClangL. E. Segovia
2024-08-15unittests: use TestCase.addCleanup for cleaning up builddirsDylan Baker
2024-07-30unittests: fix EncodingWarnings. minus 123 warnings collected by pytestEli Schwartz
2024-07-17Remove language (AKA compiler) type from OptionKey.Jussi Pakkanen
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen
2024-06-14Rename option variable to optstore to make it unique.Jussi Pakkanen
2024-03-15tests: Fix unit tests with high parallelismJan Alexander Steffens (heftig)
On Arch's shiny new 48-core/96-thread build server, the `test_install_log_content` test fails because of an unexpected `invalid-symlink.txt` file. Apparently the test runs in parallel with `test_install_subdir_symlinks`, which modifies the `59 install subdir` source directory. To fix this, make `install_subdir_invalid_symlinks` copy the entire test into a tmpdir before modifying it.
2023-12-17Skip pkg-config-dependent tests if it's missingAlyssa Ross
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-05ninja backend: don't hide all compiler warnings for transpiled languagesEli Schwartz
This was originally added for vala only, with the rationale that vala generates bad code that has warnings. Unfortunately, the rationale was fatally flawed. The compiler warns about a number of things, which the user can control depending on their code (or their code generator's code), but some of those things are absolutely critical to warn about. In particular, GCC 14 and clang 17 are updating their defaults to warn -- and error by default for -- invalid C code that breaks the standard, but has been silently accepted for over 20 years "because lots of people do it". The code in question is UB, and compilers will generate faulty machine code that behaves erroneously and probably has a mass of CVEs waiting to happen. Compiler warnings are NOT safe to just... universally turn off. Compiler warnings could be either: - coding style lints - threatening statements that the code is factually and behaviorally wrong There is no magic bullet to ignore the former while respecting the latter. And the very last thing we should ever do is pass `-w`, since that causes ALL warnings to be disabled, even the manually added `-Werror=XXX`. If vala generated code creates warnings, then the vala compiler can decrease the log level by generating better code, or by adding warning suppression pragmas for *specific* issues, such as unused functions.
2023-11-12Renumber test dirs for rc3.Jussi Pakkanen
2023-10-27Condense test directories for RC1.Jussi Pakkanen
2023-10-09Allow c++23 in gcc-11.Benjamin Redelings
2023-09-18pkgconfig: Set PKG_CONFIG in env for devenv and g-ir-scannerXavier Claessens
2023-09-18pkgconfig: Restore logging of pkg-config versionXavier Claessens
While at it, make more methods private by storing the version found on the instance. That avoids having to call check_pkgconfig() as static method from unittests.
2023-09-18Remove get_pkgconfig_variable()Xavier Claessens
Make sure that pkgconfig_define is a pair of strings and not a list with more than 2 strings.
2023-08-07Error when an installed static library links to internal custom targetXavier Claessens
When an installed static library A links to an internal static library B built using a custom_target(), raise an error instead of a warning. This is because to be usable, A needs to contain B which would require to extract the archive to get its objects files. This used to work, but was printing a warning and was installing a broken static library, because we used to overlink in many cases, and that got fixed in Meson 1.2.0. It now fails at link time with symbols from the custom target not being defined. It's better to turn the warning into a hard error at configure time. While at it, noticed this situation can happen for any internal custom or rust target we link to, recursively. get_internal_static_libraries_recurse() could be called on CustomTarget objects which do not implement it, and even if we did not call that method, it would still fail when trying to call extract_all_objects() on it. Fixes: #12006
2023-08-03PkgConfigDependency: Move CLI handling into its own abstractionXavier Claessens
This makes the code cleaner and will allow to have other implementations in the future.
2023-07-31Merge pull request #11986 from williamspatrick/clang-enable-cpp23Jussi Pakkanen
add support for newer C++ -std= flags on Clang/GCC
2023-07-14tests: add support for c++23/c++26 detectionSteven Noonan
Signed-off-by: Steven Noonan <steven@uplinklabs.net> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
2023-07-13Silence some encoding warningsTristan Partin
By specifiying explicit encodings, we can silence warnings like: /__w/meson/meson/test cases/common/100 postconf with args/postconf.py:15: EncodingWarning: 'encoding' argument not specified with open(input_file) as f: in CI.
2023-07-10build: dependencies should come after link_with on link commandXavier Claessens
This fixes regression caused by https://github.com/mesonbuild/meson/commit/3162b901cab46d66a30c66a4406195523714ecdc that changes the order in which libraries are put on the link command. In addition, that commit was wrong because libraries from dependencies were processed before process_compiler() is called, which that commit wanted to avoid.
2023-07-10build: Fix linking multiple libraries and some are promotedXavier Claessens
When a link() is promoted to link_whole() we still have to handle the rest of the list. Fixes: #11956
2023-07-05Merge pull request #11742 from xclaesse/link-whole-casesJussi Pakkanen
Fix niche cases when linking static libs
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.