aboutsummaryrefslogtreecommitdiff
path: root/unittests
AgeCommit message (Collapse)AuthorFilesLines
2024-10-23pkgconfig: fix use of uninstalled librariesAndoni Morales Alastruey1-0/+36
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-22env2mfile: Use a cross valac on Debian if possibleSimon McVittie1-0/+1
This is functionally equivalent to the logic used to locate the cross exe_wrapper, but puts it below the "Compilers" heading rather than "Other binaries". Signed-off-by: Simon McVittie <smcv@debian.org>
2024-10-22env2mfile: Automatically set exe_wrapper on Debian if possibleSimon McVittie1-0/+1
Recent versions of the architecture-properties package provide a cross-exe-wrapper package containing ${DEB_HOST_GNU_TYPE}-cross-exe-wrapper, which is currently a wrapper around qemu-user but could use different emulators on each architecture if it becomes necessary in the future. Signed-off-by: Simon McVittie <smcv@debian.org>
2024-10-22env2mfile: Use Debian cross-prefixed GObject-Introspection toolsSimon McVittie1-0/+6
In Debian testing/unstable, there are wrappers available for various GObject-Introspection tools during cross-builds, using qemu internally. Signed-off-by: Simon McVittie <smcv@debian.org>
2024-10-21backend/ninja: Fix inconsistent rule descriptionsDavid Robillard1-3/+3
Remove some trailing periods and always use present continuous tense (since these appear as status messages).
2024-10-20Add GNU/Hurd kernel resultsSamuel Thibault1-5/+1
uname -s does return gnu there. Resolves: https://github.com/mesonbuild/meson/issues/13740 Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2024-10-20Condense test directories.Jussi Pakkanen3-17/+17
2024-10-13mintro: Add license and license_files to project introspection dataDaniele Nicolodi1-1/+10
2024-10-04programs: Allow excluding certain paths when searching in PATHNirbheek Chauhan1-2/+2
2024-10-02env2mfile: Base cpu on DEB_HOST_GNU_CPU unless DEB_HOST_ARCH is specialSimon McVittie1-9/+4
`DEB_HOST_ARCH` encodes both the CPU family and the OS, so using it to get the CPU type gives the wrong answer for non-Linux ports. However, `DEB_HOST_GNU_CPU` gives less detailed information about the CPU: it's `arm` for all 32-bit ARM CPUs, and doesn't distinguish between the differing baselines of `armel` (ARMv5 softfloat) and `armhf` (ARMv7 hardfloat). When cross-compiling for x86_64 Linux, this changes the `cpu()` from `amd64` to `x86_64`, which is consistent with the answer we get during native builds on that architecture. When cross-compiling for `ppc64el`, this changes the `cpu()` from `ppc64el` to `ppc64`, which is a reasonable change but is still not consistent with what we see during native builds (which is `ppc64le`): see #13741 for that. Resolves: https://github.com/mesonbuild/meson/issues/13742 Signed-off-by: Simon McVittie <smcv@debian.org>
2024-10-02env2mfile: Don't hard-code Debian as always being LinuxSimon McVittie1-3/+4
All official Debian release architectures use the Linux kernel, but unofficial ports like hurd-i386 and kfreebsd-amd64 use the Hurd and FreeBSD kernel, respectively. Map Linux to 'linux' and kFreeBSD ports to 'freebsd' as per the reference tables in Meson's documentation. For now, use the Debian system name such as 'hurd' for anything else (see #13740 for the question of whether Hurd should identify its kernel differently). Signed-off-by: Simon McVittie <smcv@debian.org>
2024-10-02env2mfile: Map Debian GNU/Hurd to system() -> gnuSimon McVittie1-4/+2
As per <https://mesonbuild.com/Reference-tables.html>, and matching what happens when running Meson for a native build on Debian GNU/Hurd. Signed-off-by: Simon McVittie <smcv@debian.org>
2024-10-02unittests: Test env2mfile's dpkg_architecture_to_machine_infoSimon McVittie1-0/+391
This test parses several possible outputs of dpkg-architecture and asserts that they produce the expected MachineInfo. To avoid depending on suitable cross-tools being installed, use unittest.mock to override locate_path with a version that pretends that all of the tools we're interested in are in /usr/bin. Similarly, use mock environment variables to exercise what happens when we have those set. The test data used here exercises most variations: * big- and little-endianness * GNU CPU (x86_64) differing from dpkg CPU (amd64) * Linux, kFreeBSD and Hurd * special-cased architectures: x86, arm, mips64el, ppc64el expected_compilers() intentionally doesn't assume that every compiler is gcc (even though they all are, right now), because #13721 proposes adding valac which does not take a gcc suffix. Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-27linkers: Fix linker detection with clang on SolarisAlan Coopersmith1-0/+2
Fixes: #13711
2024-09-24qt module: allow has_tools to specify which tools to checkPierre Lamot1-0/+14
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-09-20rewriter: don't output target info to stderrBenoit Pierre1-4/+4
Send the info to stdout, where it belongs.
2024-09-11Fix typosspaette3-15/+15
2024-09-06mformat: detect invalid configCharles Brunet1-2/+35
- detect unknown config keys in format config - add test for detection of invalid config values - detect invalid .editorconfig values Fixes #13569
2024-09-03intro: add install_rpath to intro-install_plan.jsonDaniele Nicolodi1-0/+20
2024-08-30update various deprecation notices to call out meson 2.0Eli Schwartz1-1/+1
2024-08-26compilers: Allow prelinking with Apple ClangL. E. Segovia1-5/+2
2024-08-20linkers: skip -export_dynamic flag before MacOS 10.7Wolfgang Walther1-1/+3
The flag was only introduced in ld 224.1, as mentioned in the initial PR #13291. Resolves #13543
2024-08-20format: fix indentation of commentsCharles Brunet1-0/+15
Fixes #13508 - Fix indentation of comments in arrays - Fix indentation of comments in dicts - Fix indentation of comments in if clauses - Fix indentation of comments in foreach clauses
2024-08-15unittests: use setUpClass instead of setUp for class constant dataDylan Baker1-32/+35
for test attributes that are class constant. This reduces the work that must be done for each test case, allowing some of the setup work to be done once for the entire class.
2024-08-15unittests: use TestCase.addCleanup for cleaning up builddirsDylan Baker2-11/+4
2024-08-15unittests: use mock.patch.dict to deal with os.environDylan Baker3-12/+7
2024-08-15unittests: use os.environ.get for MESON_UNIT_TEST_BACKENDDylan Baker1-1/+1
Being unset shouldn't cause a ton of our tests to fail.
2024-08-09linkers: fix LLD linker response file handlingBenoit Pierre1-0/+9
Correct base classes so GNU-like linkers all default to supporting response files.
2024-08-04Revert "CI: skip LTO tests on cygwin"Jon Turney1-2/+0
This reverts commit 0c93149f09bbeedd03c70abc7b6d652b8e9ee9fa.
2024-08-01mformat: fix formatting of empty build fileCharles Brunet1-2/+8
Running meson format multiple times on an empty file was adding a new line each time, which is bad for pre-commit checks...
2024-07-30unittests: fix EncodingWarnings. minus 123 warnings collected by pytestEli Schwartz5-6/+6
2024-07-23CI: skip LTO tests on cygwinEli Schwartz1-0/+2
A GCC update broke this and is being investigated Bug: #13465
2024-07-21Remove the exe_exists functionMads Andreasen1-4/+0
This function is no longer used since shutil.which() is used instead.
2024-07-17Remove module type from OptionKey.Jussi Pakkanen1-2/+2
2024-07-17Remove language (AKA compiler) type from OptionKey.Jussi Pakkanen3-8/+8
2024-07-17Remove option type from OptionKey and get it from OptionStore instead.Jussi Pakkanen2-8/+8
2024-07-16unittests: Add type annotations to the helpers moduleDylan Baker1-31/+52
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen6-9/+12
2024-07-11Move project option detection into OptionStore.Jussi Pakkanen1-2/+5
2024-07-10Replace exe_exists function with shutil.which()Mads Andreasen1-0/+5
The documentation for subprocess.run at https://docs.python.org/3/library/subprocess.html#popen-constructor has a warning, pointing to using shutil.which() instead of subprocess.run for detecting if exe files exists on the path. shutil.which() is used in many places already.
2024-06-29linkers: Fix AppleDynamicLinker not returning any rpaths to removePiotr BrzeziƄski2-0/+19
Fixes regression from commit 78e9009ff9d36925e04f329f9082841002ddd848. The above commit relied on rpath_dirs_to_remove being present and correctly filled, which was never the case for the AppleDynamicLinker. The result was that all the build-dir-only RPATHs were being carried over to the installed files. This commit implements returning the list of RPATHs to remove in AppleDynamicLinker, doing pretty much the same thing as what's in the GnuLikeDynamicLinkerMixin. Thanks to that, depfixer now correctly removes build-time Meson-created RPATHs, as it used to before 1.4.1.
2024-06-14cargo: Load Cargo.lockXavier Claessens1-1/+35
Cargo.lock is essentially identical to subprojects/*.wrap files. When a (sub)project has a Cargo.lock file this allows automatic fallback for its cargo dependencies.
2024-06-14wrap: Clarify PackageDefinition APIXavier Claessens1-4/+4
This will simplify creating PackageDefinition objects from Cargo.lock file. It contains basically the same information.
2024-06-14Merge pull request #13307 from mesonbuild/optstorerefactorJussi Pakkanen4-35/+35
Convert OptionStore from a dict to a full class with named methods
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen4-35/+35
2024-06-14Rename option variable to optstore to make it unique.Jussi Pakkanen4-35/+35
2024-06-11unittests: Add Python unittest for limited APIAndrew McNulty1-1/+30
This new unittest runs the existing Python limited API test case, and checks that the resulting library was linked to the correct library.
2024-06-05Add -export_dynamic flag for AppleDynamicLinkerWolfgang Walther1-0/+12
The apple linker uses -export_dynamic instead of --export-dynamic [1]. This should be set when setting export_dynamic: true. Resolves #13290 [1]: https://opensource.apple.com/source/ld64/ld64-609/doc/man/man1/ld.1.auto.html
2024-06-04Extract native file parser to machinefile source file.Jussi Pakkanen2-2/+2
2024-06-02Create a directory for machine files used in unit tests.Jussi Pakkanen3-34/+31