aboutsummaryrefslogtreecommitdiff
path: root/unittests/allplatformstests.py
AgeCommit message (Collapse)AuthorFilesLines
2022-04-19unittests: Add test_pkgconfig_relocatable to allplatformstestsFredrik Salomonsson1-0/+33
Test that the pkgconfig prefix is actually relocatable when pkgconfig.relocatable=true and is not when pkgconfig.relocatable=false.
2022-04-13Add regression test for Python dist.Jussi Pakkanen1-5/+5
2022-03-31unittests: move get_convincing_fake_env_and_cc to run_tests.pyMarvin Scholz1-14/+3
2022-03-31unittests: add underscore prefix testsMarvin Scholz1-0/+37
Tests the two new detection methods for the underscore prefix against what is detected in the binary. Contrary to the in-the-wild failures, we can trust the binary here as we do not get any additional flags that influence the binary contents in this test environment.
2022-03-29Condense test directory names.Jussi Pakkanen1-45/+45
2022-03-24Make compilers list per subprojectXavier Claessens1-4/+8
Previously subprojects inherited languages already added by main project, or any previous subproject. This change to have a list of compilers per interpreters, which means that if a subproject does not add 'c' language it won't be able to compile .c files any more, even if main project added the 'c' language. This delays processing list of compilers until the interpreter adds the BuildTarget into its list of targets. That way the interpreter can add missing languages instead of duplicating that logic into BuildTarget for the cython case.
2022-03-13Merge pull request #9339 from dcbaker/submit/structured_sourcesJussi Pakkanen1-0/+1
Structured Sources
2022-03-09Replace freezing regex with plain text operations.Jussi Pakkanen1-2/+14
The regex in question causes Python's regex parser to freeze indefinitely in certain Python versions. That might be due to a bug or because the re does infinite backtracking and it just happened to work on earlier implementations.
2022-03-07build: plumb structured sources into BuildTargetsDylan Baker1-0/+1
2022-03-07Fix default install tag for shared lib symlinksXavier Claessens1-0/+21
Versioned shared libraries should have .so file in devel, .so.1 and .so.1.2.3 in runtime. Fixes: #9811
2022-02-09meson: Allow directory options outside of prefixJan Tojnar1-7/+7
This bring us in line with Autotools and CMake and it is useful for platforms like Nix, which install projects into multiple independent prefixes. As a consequence, `get_option` might return absolute paths for some directory options, if a directory outside of prefix is passed. This is technically a backwards incompatible change but its effect should be minimal, thanks to widespread use of `join_paths`/`/` operator and pkg-config generator module. It should only cause an issue when a path were constructed by concatenating the value of directory path option. Also remove a comment about commonpath since we do not use that since <https://github.com/mesonbuild/meson/commit/00f5dadd5b7d71c30bd7393d165a87f554eb92e5>. Fixes: https://github.com/mesonbuild/meson/issues/2561
2022-02-03cmake: ci: Skip tests on Ubuntu Bionic where CMake is stuck on 3.10Daniel Mensinger1-0/+2
2022-02-01unittests: check that "verbose: true" works on testsPaolo Bonzini1-0/+7
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-01-30ninja backend: Fix usage of same constants file for native and crossNirbheek Chauhan1-7/+7
For example: ``` meson builddir \ --native-file vs2019-paths.txt \ --native-file vs2019-win-x64.txt \ --cross-file vs2019-paths.txt \ --cross-file vs2019-win-arm64.txt ``` This was causing the error: > ERROR: Multiple producers for Ninja target "/path/to/vs2019-paths.txt". Please rename your targets. Fix it by using a set() when generating the list of regen files, and add a test for it too.
2022-01-18interpreterobjects: use typed_* for configuration_data.set*Dylan Baker1-1/+0
This removes the ability to use ConfigurationData as a dict, but restricting the inputs to `str | int | bool`. This may be a little too soon for this, and we may want to wait on that part, it's only bee 8 months since we started warning about this.
2022-01-10manually clean up some python 3.6 era codeEli Schwartz1-5/+0
2022-01-02Condense test directory numbers for rc1.Jussi Pakkanen1-4/+4
2021-12-22unit tests: Don't check quoting with multiple libsNirbheek Chauhan1-2/+2
pkgconf has a bug on MSYS2 due to which prefixes with spaces are not handled correctly if the library has a Requires: on another library and both have prefixes with spaces in them. See: https://github.com/pkgconf/pkgconf/issues/238 So move the unit test to libanswer.pc instead of libfoo.pc till that is fixed.
2021-12-22Set RPATH for all non-system libs with absolute pathsNirbheek Chauhan1-1/+1
If a pkg-config dependency has multiple libraries in it, which is the most common case when it has a Requires: directive, or when it has multiple -l args in Libs: (rare), then we don't add -Wl,-rpath directives to it when linking. The existing test wasn't catching it because it was linking to a pkgconfig file with a single library in it. Update the test to demonstrate this. This function was originally added for shared libraries in the source directory, which explains the name: https://github.com/mesonbuild/meson/pull/2397 However, since now it is also used for linking to *all* non-system shared libraries that we link to with absolute paths: https://github.com/mesonbuild/meson/pull/3092 But that PR is incomplete / wrong, because only adding RPATHs for dependencies that specify a single library, which is simply inconsistent. Things will work for some dependencies and not work for others, with no logical reason for it. We should add RPATHs for *all* libraries. There are no special length limits for RPATHs that I can find. For ELF, DT_RPATH or DT_RUNPATH are used, which are just stored in a string table (DT_STRTAB). The maximum length is only a problem when editing pre-existing tags. For Mach-O, each RPATH is stored in a separate LC_RPATH entry so there are no length issues there either. Fixes https://github.com/mesonbuild/meson/issues/9543 Fixes https://github.com/mesonbuild/meson/issues/4372
2021-11-28make sure files arguments to compiler.compiles and friends, performs rebuildEli Schwartz1-0/+7
If the compiler check is updated as a string in meson.build, we force rebuild, which is a good thing since the outcome of that check changes the configuration context and can enable or disable parts of the build. If the compiler check came from a files() object then we didn't add a regen rule on those files. Fixes #1656
2021-11-24shared_module: Add soname when used as a link targetNirbheek Chauhan1-2/+4
Emit a detailed deprecation warning that explains what to do instead. Also add a unittest. ``` DEPRECATION: target prog links against shared module mymod, which is incorrect. This will be an error in the future, so please use shared_library() for mymod instead. If shared_module() was used for mymod because it has references to undefined symbols, use shared_libary() with `override_options: ['b_lundef=false']` instead. ``` Fixes https://github.com/mesonbuild/meson/issues/9492
2021-11-24unit tests: Extend prebuilt test to test intermediateDylan Baker1-0/+23
This provides coverage for the bug: https://github.com/mesonbuild/meson/issues/9542
2021-11-24unittests: use UnitTest.addCleanup a bitDylan Baker1-11/+14
2021-11-23interpreter: extract_objects provides a valid sourcePaolo Bonzini1-0/+6
This ensures that there is no warnings when running meson on test cases/common/22 object extraction. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-20Feature kwargs decorator: automatically report the nodes which trigger an issueEli Schwartz1-2/+2
2021-10-27Fix add_install_script() ignoring install_tagXavier Claessens1-10/+12
Fixes: #9454
2021-10-27test_clang_format: Do not assume meson source is in gitXavier Claessens1-0/+8
Fixes: #9437
2021-10-26unittests: use better assert methodsEli Schwartz1-16/+16
assertTrue and assertFalse are recommended against, if you can get a more specific assertion. And sometimes it is considerably shorter, for example we have a custom assertPathExists which we can take advantage of.
2021-10-26do not save unused variableEli Schwartz1-1/+1
Constructing a PackageDefinition is enough to assert that it raises an error.
2021-10-26remove unused variableEli Schwartz1-1/+1
It never made sense here to save self.init() which returns a string containing a log or stdout or something, and which was never actually used. Also we then overwrote the variable with a pathname...
2021-10-26remove dead code that is immediately overriddenEli Schwartz1-4/+0
In commit d932cd9fb48e8fecb167641c3d6bee8a68831c6e, we migrated to meson's own static linker definition, and the old code that hardcoded two of the possible exelists should have been removed in the process.
2021-10-26do not save variable when all we want is the side effect of popping itEli Schwartz1-1/+1
It's redefined on every loop iteration, and as the comment says, we just want to make sure the next loop skips a value.
2021-10-14introspect: include choices for array optionsPaolo Bonzini1-2/+5
There was even a test covering this, but it did not fail due to a typo.
2021-10-10Fix typos discovered by codespellChristian Clauss1-1/+1
2021-10-10clangformat: Only format files tracked by git by defaultXavier Claessens1-0/+14
2021-10-10ar linker: generate thin archives for uninstalled static librariesEli Schwartz1-1/+1
Since they will never be used outside of the build directory, they do not need to literally contain the .o files, and references will be sufficient. This covers a major use of object libraries, which is that the static library would potentially take up a lot of space by including another copy of every .o file. Fixes #9292 Fixes #8057 Fixes #2129
2021-10-04various python neatness cleanupsEli Schwartz1-2/+2
All changes were created by running "pyupgrade --py3-only" and committing the results. Although this has been performed in the past, newer versions of pyupgrade can automatically catch more opportunities, notably list comprehensions can use generators instead, in the following cases: - unpacking into function arguments as function(*generator) - unpacking into assignments of the form x, y = generator - as the argument to some builtin functions such as min/max/sorted Also catch a few creeping cases of new code added using older styles.
2021-10-01rust: dependencies need to cause a rebuild/relink not just reorderDylan Baker1-0/+32
Otherwise changes to a dependency don't propogate
2021-09-30Make custom_target() name argument optionalXavier Claessens1-0/+8
2021-09-28Merge pull request #9014 from bonzini/mixed-language-linkJussi Pakkanen1-0/+14
Use appropriate compiler for the source file for "links" tests with file argument
2021-09-27fix test case instances where undefined message(true) occurredEli Schwartz1-2/+2
2021-09-24compilers/rust: Add support for clippyDylan Baker1-0/+13
Clippy is a compiler wrapper for rust that provides an extra layer of linting. It's quite popular, but unfortunately doesn't provide the output of the compiler that it's wrapping in it's output, so we don't detect that clippy is rustc. This small patch adds a new compiler class (that is the Rustc class with a different id) and the necessary logic to detect that clippy is in fact rustc) Fixes: #8767
2021-09-21coredata: 0.59.1 -> 0.59.99 is a major version differenceXavier Claessens1-25/+3
Remove test_minor_version_does_not_reconfigure_wipe() because when run during dev cycle that test reconfigure with .99 -> .100 which is considered a major version change now. It is covered by a more efficient internal test now anyway. While at it, remove no-op `with Path(self.builddir):` statement, the intention was clearly to set workdir. Fixes: #9260
2021-09-16Fix ignored install_tag kwarg in install_subdir()Xavier Claessens1-0/+2
Fixes: #9263
2021-09-14backends/vs: Do not emit dummy command for alias_command().Andres Freund1-3/+0
Alias commands did not work with the vs backend, due to trying to access target.command[0] with an empty command. Fix this by just not emitting a CustomBuild node for alias targets - the project references are enough to trigger the necessary actions. Fixes: #9247
2021-09-07unittests: test external dependency in summaryPaolo Bonzini1-3/+8
This requires a bit of extra code because the version might change, but otherwise it fits in the existing AllPlatformTests.test_summary testcase Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-07add test case for mixed language link testsPaolo Bonzini1-0/+14
2021-09-06mintro: add installed_planFilipe Laíns1-3/+179
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-09-03tests: when generating git repositories, make sure that pgpsign is offEli Schwartz1-1/+1
I have a local configuration tag.forcesignannotated=true commit.gpgsign=true This causes the tests to fail with e.g. error: gpg failed to sign the data fatal: failed to write commit object Since this is a unittest, it is never wrong to tell git "just ignore prior configuration, and disable all PGP signing".
2021-09-02interpreter: Add summary of all user defined optionsXavier Claessens1-1/+7
It is a commonly needed information to help debugging build issues. We already were printing options with non-default value at the end of the configure but outside of the summary. Keeping the list of user defined options in the interpreter will also in the future be useful to use new default value on reconfigure.