aboutsummaryrefslogtreecommitdiff
path: root/test cases/common
AgeCommit message (Collapse)AuthorFilesLines
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.
2020-07-30pkgconfig: Fix various corner casesXavier Claessens3-1/+47
See unit tests for the exact scenarios this PR fixes.
2020-07-28ninjabackend: check if target has compiler attributeMarcel Hollerbach1-1/+3
otherwise we are getting errors like: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mesonbuild/mesonmain.py", line 131, in run return options.run_func(options) File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 245, in run app.generate() File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 159, in generate self._generate(env) File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 215, in _generate intr.backend.generate() File "/usr/local/lib/python3.6/dist-packages/mesonbuild/backend/ninjabackend.py", line 518, in generate self.generate_coverage_rules() File "/usr/local/lib/python3.6/dist-packages/mesonbuild/backend/ninjabackend.py", line 991, in generate_coverage_rules self.generate_coverage_command(e, []) File "/usr/local/lib/python3.6/dist-packages/mesonbuild/backend/ninjabackend.py", line 975, in generate_coverage_command for compiler in target.compilers.values(): AttributeError: 'RunTarget' object has no attribute 'compilers' This extends the 109 generatecode test case to also define a test, so coverage can really detect something.
2020-07-22coredata: Make warning_level per subproject builtin optionXavier Claessens3-2/+9
2020-07-20string: add substring methodStéphane Cerveau1-0/+15
This method aims to offer a simple way to 'substring' an existing string with start and end values.
2020-07-19Stabilize keyval moduleMarc-André Lureau1-1/+1
We have experimented with the module for about a year in a qemu branch (https://wiki.qemu.org/Features/Meson), and we would like to start moving the build system to meson. For that, keyval should have the stability guarantees. Cc: Paolo Bonzini <pbonzini@redhat.com>
2020-07-01interpreter: Don't abort if dep isn't required and sub didn't overrideXavier Claessens2-1/+8
2020-07-01interpreter: Already configured fallback should be used for optional depXavier Claessens3-0/+11
2020-07-01find_program: Fallback if a wrap file provide the program nameXavier Claessens3-0/+12
We don't need the legacy variable name system as for dependency() fallbacks because meson.override_find_program() is largely used already, so we can just rely on it.
2020-07-01wrap: Add special 'dependency_names' key in [provide] sectionXavier Claessens2-3/+3
The value for that key must be a coma separated list of dependecy names provided by that subproject, when no variable name is needed because the subproject uses override_dependency().
2020-07-01wrap: Add 'provide' sectionXavier Claessens3-0/+20
2020-07-01Implicit dependency fallback when a subproject wrap or dir existsXavier Claessens2-0/+8
2020-06-24pkgconfig: Add missing cflags in uninstalled filesXavier Claessens2-1/+6
Fixes: #7365
2020-06-22Fix "test cases/common/125 object only target" on SolarisAlan Coopersmith1-0/+2
If object is not built pic, trying to link it into libshr.so fails: [6/8] Linking target libshr.so. FAILED: libshr.so gcc -o libshr.so 'shr@sha/source2.o' -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-soname,libshr.so -Wl,--end-group Text relocation remains referenced against symbol offset in file .text (section) 0x20 shr@sha/source2.o ld: fatal: relocations remain against allocatable but non-writable sections collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-21wrap: Add patch_directory supportXavier Claessens3-0/+13
Copy a tree instead of extracting an archive. Closes: #7216
2020-06-05test cases/common/234: get limit right on linux, generate fewer filesDan Kegel1-2/+25
2020-06-05Extended test case for special characters to compiler argumentsJon Turney4-0/+77
2020-06-05Add a test case for very long command linesJon Turney4-0/+38
This exercises commands of about 20K in length Also test short commandlines to make sure they don't regress.
2020-05-27Merge pull request #6818 from mensinda/localPatchJussi Pakkanen12-8/+30
Wrap: add local files support via *_filename
2020-05-27ninja: Always use to_native on CompilerArgs (fixes #7167)Daniel Mensinger3-0/+19
2020-05-26opts: Allow string concatenation (fixes #7199)Daniel Mensinger1-3/+3
2020-05-14interpreter: Rename has_exe_wrapper -> can_run_host_binariesDylan Baker2-2/+2
The implementation of this function has changed enough that the name doesn't really reflect what it actually does. It basically returns true unless you're cross compiling, need and exe_wrapper, and don't have one. The original function remains but is marked as deprecated. This makes one small change the meson source language, which is that it defines that can_run_host_binaries will return true in build == host compilation, which was the behavior that already existed. Previously this was undefined in build == host compilation.
2020-05-08Allow indexed custom target to be used in executable's depends.Szabi Tolnai3-0/+42
Change-Id: I7f3e0e0dd9c413d7f6e3267de9664b89f2294e27
2020-05-08rename unstable-kconfig to unstable-keyvalPaolo Bonzini1-3/+3
Discussions in #6524 have shown that there are various possible uses of the kconfig module and even disagreements in the exact file format between Python-based kconfiglib and the tools in Linux. Instead of trying to reconcile them, just rename the module to something less suggestive and leave any policy to meson.build files. In the future it may be possible to add some kind of parsing through keyword arguments such as bool_true, quoted_strings, etc. and possibly creation of key-value lists too. For now, configuration_data objects provide an easy way to access quoted strings. Note that Kconfig stores false as "absent" so it was already necessary to write "x.has_key('abc')" rather than the more compact "x['abc']". Therefore, having to use configuration_data does not make things much more verbose.