aboutsummaryrefslogtreecommitdiff
path: root/unittests/linuxliketests.py
AgeCommit message (Collapse)AuthorFilesLines
2022-11-21Handle freezing tests. Fixes #10752.Jussi Pakkanen1-0/+8
2022-11-17tests: fix potential failure to verify pkg-config generationEli Schwartz1-1/+1
We use a dummy project with a vague name and try to find flags for it based on the installable pkg-config files. This sort of works, generally, because it attempts to match `-lct` which doesn't exist because the test case isn't installed, and that link argument is passed directly through. Except, sometimes that library does exist. It is provided by the "freetds" project, which may be a dependency other tools. In that case, Meson finds a library, and the `dependency()` resolves to `/usr/lib/libct.so` and the test fails. Fortunately, we do have an API to say that we really want to get back the same flags pkg-config returned. Use this.
2022-11-01minstall: make do_strip run with -Sx for macOS targetsL. E. Segovia1-6/+22
This commit also adds some extra symbol noise to lib.c, in order to aid detection of the debug information with nm. Fixes #10943
2022-10-25Condense test directory numbers.Jussi Pakkanen1-3/+3
2022-09-22modules/gnome: make_native_glib_version an instance varDylan Baker1-5/+2
This removes the need for the use of the global statement. I've also updated the test that overrides this to use mock.patch instead of hand monkey patching.
2022-09-19compilers: don't export every compiler as a top-level propertyEli Schwartz1-2/+4
This is wasteful and generally unneeded, since code can just use the compiler they detected instead of manually poking at the internals of this subpackage. It also avoids importing an absolute ton of code the instant one runs `from . import compilers`
2022-09-13Use os.path.realpath for default include paths testing in -isystem.Yang Bo1-0/+12
This ensures correct removal of default include paths in -isystem options when symbolic links are involved. A test for this is also added.
2022-08-23install modes should not apply sticky bit to filesEli Schwartz1-5/+5
This is generally a bad idea, e.g. it causes OSError on freebsd. It also gets ignored by solaris and thus causes unittest failures. The proper solution is to simply reject any attempt to set this, and log a warning. The install_emptydir function does apply the mode as well, and since it is a directory it actually does something. This is the only place where we don't reset the mode. Although install_subdir also installs directories, and in theory it could set the mode as well, that would be a new feature. Also it doesn't provide much granularity and has mixed semantics with files. Better to let people use install_emptydir + install_subdir. Fixes #5902
2022-07-07Fix test case numbers.Jussi Pakkanen1-3/+3
2022-05-06unittests: Skip prelinking test with gcc 8 or olderSimon McVittie1-4/+2
This was already skipped when running on the Ubuntu 18.04 version of gcc, but it also fails with gcc 8.3.0 on Debian 10. Instead of hard-coding specific versions to look for, do a version comparison. Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-30pkgconfig: Use EnvironmentVariables to build PKG_CONFIG_* envXavier Claessens1-2/+5
The new get_env() method that returns an EnvironmentVariables object will be needed in next commit that will pass it to CustomTarget. This has the side effect to use the proper os specific path separator instead of hardcoding `:`. It is the obvious right thing to do here, but has caused issues in the past. Hopefully issues have been fixed in the meantime. If not, better deal with fallouts than keep doing the wrong thing forever.
2022-04-30linkers: Add support for mold linkerFini Jastrow1-2/+2
[why] Support for the relatively new mold linker is missing. If someone wants to use mold as linker `LDFLAGS="-B/path/to/mold"` has to be added instead of the usual `CC_LD=mold meson ...` or `CXX_LD=mold meson ...`. [how] Allow `mold' as linker for clang and newer GCC versions (that versions that have support). The error message can be a bit off, because it is generic for all GNU like compilers, but I guess that is ok. (i.e. 'mold' is not listed as possible linker, even if it would be possible for the given compiler.) [note] GCC Version 12.0.1 is not sufficient to say `mold` is supported. The expected release with support will be 12.1.0. On the other hand people that use the un-released 12.0.1 will probably have built it from trunk. Allowing 12.0.1 is helping bleeding edge developers to use mold in Meson already now. Fixes: #9072 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-04-12qt dependency: adapt to the qmake command changed nameEli Schwartz1-2/+2
Qt now has official guidance for the symlinked names of the tools, which is great. Qt now officially calls the tools `fooX` instead of `foo-qtX` where the major version of Qt is X. Which is not great, because a bit of an unofficial standard had prior art and now needs to change, and we never adapted. Prefer the official name whenever looking up qmake, and in the testsuite, specifically look only for the official name on versions of qt which we know should have that.
2022-04-03Document and test env vars a bit betterJohn Ericson1-4/+2
2022-03-29Condense test directory names.Jussi Pakkanen1-26/+26
2022-03-22tests/linuxlike: prepend rather than override PKG_CONFIG_PATHDylan Baker1-5/+17
If you rely on PKG_CONFIG_PATH to make anything work (like nixos) then these tests cannot pass without the system values appended to the override values.
2022-03-22tests/linuxlike: Honor PKG_CONFIG envvarDylan Baker1-14/+16
For some of us, we need to use this to get the right pkg-config. If the variable is unset, `'pkg-config'` is used.
2022-03-09install: Add --strip optionXavier Claessens1-0/+20
2022-01-30ninja backend: Fix usage of same constants file for native and crossNirbheek Chauhan1-8/+15
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-18dependencies: don't pass kwargs from get_pkgconfig_variableDylan Baker1-6/+6
This is a layering violation, we're relying on the way the interpreter handles keyword arguments. Instead, pass them as free variables, destructuring in the interpreter
2022-01-10pyupgrade --py37-plusEli Schwartz1-1/+1
2022-01-02Condense test directory numbers for rc1.Jussi Pakkanen1-2/+2
2021-11-24shared_module: Add soname when used as a link targetNirbheek Chauhan1-0/+18
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-10-31Fix cygwin test failure due to shortpath usageNirbheek Chauhan1-0/+6
Two tests are failing on Cygwin because the argument is passed as a long-path and the Path is ending up as a short-path: AllPlatformTests.test_run_target_files_path Traceback (most recent call last): File "/cygdrive/d/a/meson/meson/test cases/common/51 run target/check-env.py", line 22, in <module> assert build_root == env_build_root AssertionError SubprojectsCommandTests.test_purge > self.assertEqual(deleting(out), sorted([ str(self.subprojects_dir / 'redirect.wrap'), str(self.subprojects_dir / 'sub_file'), str(self.subprojects_dir / 'sub_git'), ])) E AssertionError: Lists differ: ['/cygdrive/c/Users/runneradmin/AppData/Local/Temp/tmpeaa2a49[205 chars]git'] != ['/cygdrive/c/Users/RUNNER~1/AppData/Local/Temp/tmpeaa2a49z/s[196 chars]git'] [...] ['/cygdrive/c/Users/runneradmin/AppData/Local/Temp/tmpeaa2a49z/src/subprojects/redirect.wrap', ^^^^^^^^^^^ ['/cygdrive/c/Users/RUNNER~1/AppData/Local/Temp/tmpeaa2a49z/src/subprojects/redirect.wrap', ^^^^^^^^ The fix is to not use the tempdir for all tests, but only for tests that check the mode.
2021-10-26unittests: use better assert methodsEli Schwartz1-8/+8
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-08cmake: handle arguments in the [binaries] section of the machine filePaolo Bonzini1-0/+32
Sometimes, the machine file can include compiler command line options, in order to pick the correct multilib. For example, Meson uses "$cc --print-search-dirs" to find the library search path, where $cc is the cc from the machine file. Because the outputs of "gcc -m32 --print-search-dirs" and "gcc --print-search-dirs" are different, this only works if you have [binaries] cc = ['gcc', '-m32'] in the machine file. Right now, however, the cmake module assumes that the compiler listed in the machine file is either a compiler, or a "launcher" followed by the compiler. Check if the second argument starts with a slash (for Microsoft-like compilers) or a dash (for everyone else), and if so presume that the CMAKE_*_COMPILER_LAUNCHER need not be defined.
2021-09-29pkgconfig: pkg-configs version<0.29.1 escape variables incorrectlymakise-homura1-1/+2
2021-09-25unittests: Make test_prelinking work on SolarisAlan Coopersmith1-3/+6
Running 'cc --version' finds the Solaris Studio C compiler, not gcc, and it doesn't support --version.
2021-08-20unittests: Ensure that symlink is removed after tests completeDylan Baker1-3/+7
using `TestCase.addCleanup` is both neat and tidy, and also ensures that the cleanup will be done, even if the test fails.
2021-08-15editorconfig: add setting to trim trailing whitespaceEli Schwartz1-6/+5
and clean up all outstanding issues Skip 'test cases/common/141 special characters/meson.build' since it intentionally uses trailing newlines.
2021-08-09pkg-config: support for `-l:libfoo.a`lilinzhe1-0/+43
fixs: #9000 Meson not correctly process with -l:xxx.a link arguments in pkgconfig .pc file. see also:https://stackoverflow.com/questions/48532868/gcc-library-option-with-a-colon-llibevent-a with unit test, unit test will be partially skiped if pkg-config version < 0.28 . see: https://gitlab.freedesktop.org/pkg-config/pkg-config/-/blob/master/NEWS
2021-07-26Split run_unittests.py fileXavier Claessens1-0/+1649