aboutsummaryrefslogtreecommitdiff
path: root/test cases/common
AgeCommit message (Collapse)AuthorFilesLines
2021-02-09backends: Fix custom_target() with configure_file() exeXavier Claessens1-1/+4
2021-02-09Condense test directory names in preparation for rc1.Jussi Pakkanen5-0/+0
2021-02-08Fix exe wrapper detection for run targets.Jussi Pakkanen1-2/+7
2021-02-07Make installing non-existing subdirs a supported featurePeter Hutterer2-1/+5
install_subdir() with a non-existing subdir creates the directory in the target directory. This seems like an implementation detail but is quite useful to create new directories for e.g. configuration or plugins in the installed locations. git bisect says this started with 8fe816101467e66792251b4f57e0ddddb537764a. Let's add a test for it and document it to make this behavior official. Limitation: it can only create at the install_dir location, trying to create nested subdirectories does not work and indeed creates the wrong directory structure. That is a bug that should be fixed separately: install_subdir('blah', install_dir: get_option('prefix')) install_subdir('sub/foobar', install_dir: get_option('prefix')) install_subdir('foo/baz', install_dir: get_option('prefix')) $ tree ../_inst ../_inst ├── baz ├── blah └── foobar Fixes #2904
2021-02-05run_target: Add env kwargXavier Claessens2-0/+15
Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
2021-02-04Introduce `fs.read` to read a file as a stringLuke Drummond5-0/+26
Following #7890, this patch introduces the ability to read the contents of a file to the fs module. This patch introduces the ability to read files at configure time, but has some restrictions: - binary files are not supported (I don't think this will prove a problem, and if people are wanting to do something with binary files, they should probably be shelling out to their own script). - Only files outside the build directory allowed. This limitation should prevent build loops. Given that reading an arbitrary file at configure time can affect the configuration in almost arbitrary ways, meson should force a reconfigure when the given file changes. This is non-configurable, but this can easily be changed with a future keyword argument.
2021-02-01tests/common: fix " 37 has function" test on musl systems.Érico Rolim1-12/+21
This commit fixes the test that asserts on whether the lchmod() function should have been detected as available by Meson. It does so by assuming that on Linux systems not using glibc, the function will be available. - fix comment about lchmod on Linux: musl has implemented the function correctly since 2013, so the assumption in the test wasn't correct. Furthermore, musl doesn't use glibc's stub mechanism. - fix include to receive __GLIBC__ definition: including almost any header in glibc will end up defining __GLIBC__, since most headers include <features.h>. The <gnu/libc-version.h> header was probably chosen because of its name, but its actual purpose is defining functions for checking glibc version at runtime (instead of what the binary was built with), so it isn't necessary to use it. Since it is a completely non standard header, including it makes the test suite fail on musl due to not finding the header.
2021-01-30Fix executable as script on WindowsXavier Claessens4-2/+32
On Windows this would fail because of missing DLL: ``` mylib = library(...) exe = executable(..., link_with: mylib) meson.add_install_script(exe) ``` The reason is on Windows we cannot rely on rpath to find libraries from build directory, they are searched in $PATH. We already have all that mechanism in place for custom_target() using ExecutableSerialisation class, so reuse it for install/dist/postconf scripts too. This has bonus side effect to also use exe_wrapper for those scripts. Fixes: #8187
2021-01-29Can read project version from a file.Jussi Pakkanen2-1/+2
2021-01-27intepreter: Allow using file objects for the script_name of add_*_scriptDylan Baker3-0/+9
It's a bit silly and conveluted to have to call find_program on the output of configure_file, so let's just allow passing files as the script name.
2021-01-27custom_target: Add env kwargXavier Claessens2-0/+2
2021-01-13Fix misspellsAntonin Décimo1-2/+2
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-12Interpreter: Fix nested subsubproject detectionXavier Claessens3-0/+10
A sub-subproject can be configured directly from `subprojects/foo/subprojects/bar/` in the case `bar` is in the same git repository as `foo` and not downloaded separately into the main project's `subprojects/`. In that case the nested subproject violation code was wrong because it is allowed to have more than one "subprojects" in path (was not possible before Meson 0.56.0). Example: - self.environment.source_dir = '/home/user/myproject' - self.root_subdir = 'subprojects/foo/subprojects/bar' - project_root = '/home/user/myproject/subprojects/foo/subprojects/bar' - norm = '/home/user/myproject/subprojects/foo/subprojects/bar/file.c' We want `norm` path to have `project_root` in its parents and not have `project_root / 'subprojects'` in its parents. In that case we are sure `file.c` is within `bar` subproject.
2020-12-30Handle uppercase dependency names in wraps.Jussi Pakkanen5-0/+30
2020-11-29Add aarch64 assembly testmimi899991-1/+10
2020-11-17Revert "Add thinlto support. Closes #7493."Jussi Pakkanen1-1/+1
This reverts commit 3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d.
2020-11-12interpreter: Add get_keys function for configuration_data (#7887)Jones1-0/+1
2020-11-12Merge pull request #7965 from dcbaker/wip/2020-11/macos-github-actionsJussi Pakkanen1-0/+2
Migrate osx CI from travis to github actions
2020-11-12dependencies: Put pkgconfig options before operandsHaelwenn (lanodan) Monnier1-1/+1
This fixes building with meson when the POSIX behavior of getopt is used, such as when GNU libc is used with POSIXLY_CORRECT=1 defined
2020-11-10tests/28 multiline string: include required headersDylan Baker1-0/+2
we're relying on printf being defined with stdio.h, which happens to work sometimes. It doesn't work with Apple clang though.
2020-11-08Add thinlto support. Closes #7493.Jussi Pakkanen1-1/+1
2020-11-05docs: Recommend to use SPDX license identifiers [skip ci]Michael Weiss1-3/+3
Some license identifiers are ambiguous (e.g. "GPL3"). The SPDX license identifiers avoid this by providing standardized and unique identifiers (e.g. "GPL-3.0-only" or "GPL-3.0-or-later" for the previous example). Because SPDX short-form identifiers are also both human- and machine-readable we should recommend them in the documentation. More information (advantages, details, etc.) can be found here: - https://spdx.dev/resources/use/#identifiers - https://spdx.dev/ids/ Fix #7905.
2020-11-03Condense test directory names again.Jussi Pakkanen1001-0/+0
2020-10-16Add test case for "subproject:opt" in project()Xavier Claessens3-0/+7
This is regression test for #7573
2020-10-16Fix consistency in variables kwargXavier Claessens2-1/+5
Share common code to extract the `variables` kwarg in declare_dependency() and pkg.generate().
2020-10-13wrap: Use sub-subproject packagefilesXavier Claessens1-0/+0
2020-10-13Merge wraps from subprojects into wraps from main projectXavier Claessens4-0/+18
wraps from subprojects are now merged into the list of wraps from main project, so they can be used to download dependencies of dependencies instead of having to promote wraps manually. If multiple projects provides the same wrap file, the first one to be configured wins. This also fix usage of sub-subproject that don't have wrap files. We can now configure B when its source tree is at `subprojects/A/subprojects/B/`. This has the implication that we cannot assume that subproject "foo" is at `self.subproject_dir / 'foo'` any more.
2020-10-13include_type: honor include_type in dependency fallbacks (fixes #7503)Daniel Mensinger1-0/+3
2020-10-12Merge pull request #7740 from bonzini/fallback-falseJussi Pakkanen3-0/+16
Allow blocking/forcing automatic subproject search
2020-10-10add test case for #6365Sahnvour5-0/+35
2020-10-08dependency: support boolean argument "allow_fallback"Paolo Bonzini3-0/+16
Sometimes, distros want to configure a project so that it does not use any bundled library. In this case, meson.build might want to do something like this, where slirp is a combo option with values auto/system/internal: slirp = dependency('', required: false) if get_option('slirp') != 'internal' slirp = dependency('slirp', required: get_option('slirp') == 'system') endif if not slirp.found() slirp = subproject('libslirp', ...) .variable('...') endif and we cannot use "fallback" because the "system" value should never look for a subproject. This worked until 0.54.x, but in 0.55.x this breaks because of the automatic subproject search. Note that the desired effect here is backwards compared to the policy of doing an automatic search on "required: true"; we only want to do the search if "required" is false! It would be possible to look for the dependency with `required: false` and issue the error manually, but it's ugly and it may produce an error message that looks "different" from Meson's. Instead, with this change it is possible to achieve this effect in an even simpler way: slirp = dependency('slirp', required: get_option('slirp') != 'auto', allow_fallback: get_option('slirp') == 'system' ? false : ['slirp', 'libslirp_dep']) The patch also adds support for "allow_fallback: true", which is simple and enables automatic fallback to a wrap even for non-required dependencies.
2020-10-05machinefiles: Allow keys to be stored case insensitiveDylan Baker2-0/+10
This is required to make the various keys in the [user options] section work the same as they do in the meson_options.txt file, where we don't have any rules about case sensitivity. There is some risk here. Someone may be relying on this lower by default behavior, and this could break their machine files. Fixes #7731
2020-10-04Added subdir files testOskar Sigvardsson3-0/+5
2020-09-28Add meson.project_build/source_root() methodsXavier Claessens4-2/+11
2020-09-17project tests: Verify that UWP cross binaries use the right archNirbheek Chauhan2-0/+38
This is a test for https://github.com/mesonbuild/meson/pull/7021, to verify that `link.exe` uses the correct architecture when targeting ARM64. Can be extended to other cross targets later.
2020-09-13external-project: New module to build configure/make projectsXavier Claessens9-0/+126
This adds an experimental meson module to build projects with other build systems. Closes: #4316
2020-09-11Fix test 'common/122 llvm ir and assembly' for Windows ARMJon Turney3-10/+59
2020-09-11Skip test 'common/121 shared modules' on Windows UWPJon Turney1-1/+19
2020-09-10Split tests out from 'common' which require a native compilerJon Turney42-622/+7
Split out tests (and parts of tests) which require a native compiler from the 'common' suite to a new suite called 'native', so we can selectively avoid running those tests when only a cross-compiler is available. Also move test '211 cmake module' to 'cmake' suite, since it appears that the way we use cmake requires a native compiler.
2020-08-30Be stricter when detecting Windows/CygwinChristoph Reiter1-1/+1
This removes the check for "mingw" for platform.system(). The only case I know where "mingw" is return is if using a msys Python under a msys2 mingw environment. This combination is not really supported by meson and will result in weird errors, so remove the check. The second change is checking sys.platform for cygwin instead of platform.system(). The former is document to return "cygwin", while the latter is not and just returns uname(). While under Cygwin it uname() always starts with "cygwin" it's not hardcoded in MSYS2 and starts with the environment name. Using sys.platform is safer here. Fixes #7552
2020-08-27tests: update .gitignoreDaniel Mensinger1-0/+1
2020-08-27tests: fix lchmod check for glibc >= 2.32 (fixes #6784)Daniel Mensinger1-6/+14
2020-08-18prevent disabler() object from overwriting arrays (#7484)Elliot2-0/+10
* prevent disabler object from overwriting arrays fixes #7107 * fix failing test forgot that func() != func(void) in c
2020-08-13add testcase for issue #5182Paolo Bonzini1-0/+3
Issue #5182 (" extract_objects returns duplicate objects") has been fixed. Add a testcase to ensure it does not regress.
2020-08-12Test for spurious warning from get_target_filenamePaolo Bonzini3-0/+10
Fixed by #7494 without a test, so here's a test. Extracted from https://github.com/mesonbuild/meson/pull/7539
2020-08-08mtest: fix skipping with various prefixesMarc-André Lureau1-0/+1
According to the specification: https://testanything.org/tap-specification.html#skipping-tests The harness should report the text after # SKIP\S*\s+ as a reason for skipping. (it's not exactly like the TODO directive, the phrasing/presentation of the spec could be improved).
2020-08-08common/234: avoid intermittent failure by dynamic path length generationMichael Hirsch5-20/+39
2020-08-05mtest: TestResult.SKIP is not a failure (#7525)Simon McVittie3-0/+56
* mtest: TestResult.SKIP is not a failure If some but not all tests in a run were skipped, then the overall result is given by whether there were any failures among the non-skipped tests. Resolves: https://github.com/mesonbuild/meson/issues/7515 Signed-off-by: Simon McVittie <smcv@debian.org> * Add test-cases for partially skipped TAP tests issue7515.txt is the output of one of the real TAP tests in gjs, which failed as a result of #7515. The version inline in meson.build is a minimal reproducer. Signed-off-by: Simon McVittie <smcv@debian.org>
2020-08-04tests/common/227: remove unneeded is_git_checkoutMichael Hirsch, Ph.D1-12/+6
2020-08-04tests/common/227: don't have symlink in GitMichael Hirsch2-3/+4
Windows Git users with symlinks have a constantly dirty repo from this "a_symlink". This change generates a symlink in the build directory when the test is run.