Commit Graph

1035 Commits

Author SHA1 Message Date
63f1b5bb70 unit tests: Pass args to pytest
Gets --help working and --failfast too.
2020-06-11 07:10:43 +00:00
18b99b3bc3 compilers: corretify deduplication direction
so: when building compile args, meson is deduplicating flags. When a
compiler argument is appended, a later appearance of a dedup'ed is going
to remove a earlier one. If the argument is prepended, the element
*before* the new one is going to be removed. And that is where the
problem reported in https://github.com/mesonbuild/meson/pull/7119 is
coming in. In the revision linked there, the order of replacement in the
prepend case was revesered.

With this patch, we restore this behaviour again.
2020-06-11 01:42:59 +03:00
25085483b9 run_unittests.py: skip test_internal_include_order for now if forcing response files on msys2
That test looks at the compdb very carefully, but
isn't yet set up to handle gcc responsefile quoting on windows, it seems.
2020-06-05 14:15:32 -07:00
210b57a136 ast: add unittest 2020-05-23 18:13:25 +02:00
2b1ca518cf Merge pull request #7123 from dcbaker/use-feature-deprecated
Use FeatureDeprecated (and other cleanups)
2020-05-22 17:08:44 +03:00
589a6249f0 Merge pull request #5986 from dcbaker/fix-tests-with-cross-binary-arguments
Fix tests with cross binary arguments
2020-05-19 00:23:19 +03:00
b4b1a2c5a1 Build private directory name from output file name. 2020-05-19 00:22:45 +03:00
af787874a8 pass exe_wrapper to test scripts through the environment
This adds a new MESON_EXE_WRAPPER environment variable containing the
string form of the exe_wrapper, if there is an exe_wrapper defined.

Fixes #4427
2020-05-18 13:53:58 -07:00
0ec94ca062 backends: Consider arguments passed to a test when cross compiling
Otherwise a wrapper script which takes an executable as an argument will
mistakenly run when that executable is cross compiled. This does not
wrap said executable in an exe_wrapper, just skip it.

Fixes #5982
2020-05-18 13:53:58 -07:00
cb6662b572 backends: ensure that test executables can be run when passed as arguments
If an executable is passed as an argument to a script in the build
directory that it resides in then it will not execute (on *nix) due to a
lack of ./. Ie, `foo` must be called as `./foo`. If it is called from a
different directory it will work. Ie `../foo` or `bar/foo`.

Fixes #5984
2020-05-18 13:53:58 -07:00
e822889754 tests: Add tests for cross file exe_wrapper
tests needs_exe wrapper but doesn't have one, !needs_exe_wrapper, and
needs_exe_wrapper and has one.
2020-05-18 13:53:58 -07:00
88f4bc6b55 run_unittests: move cross_file_system_paths to the cross tests 2020-05-18 13:53:58 -07:00
751ea3df72 Merge pull request #7103 from dankegel/bug4027-rpath-remember
Let .pc files and LDFLAGS provide rpaths.
2020-05-18 23:17:34 +03:00
f8cfb74e9b Let LDFLAGS specify rpath.
Fixes #2567
2020-05-16 20:26:03 +00:00
d7235c5905 Let .pc files specify rpath.
Fixes #4027
2020-05-16 20:25:58 +00:00
cb4e4f625f run_unittests: Use unittest.mock instead of a handrolled mock 2020-05-14 12:15:03 -07:00
cb97c3baf8 unit tests: Fix broken test_cross_libdir test
test_cross_libdir() was broken because we were passing `--libdir=lib`
when invoking meson.

We didn't notice that https://github.com/mesonbuild/meson/issues/6115
broke because of this.
2020-05-14 15:38:44 +00:00
ab6a410426 macos: Remove framwork linkerlike args
fixes-up 33fbc548ab
2020-05-13 15:55:07 +00:00
4ea7c6ee12 Merge pull request #7064 from dcbaker/gtest-protocol
Add support for Gtest as a test protocol
2020-05-06 23:57:44 +03:00
083c5f6357 Add native support for gtest tests
Gtest can output junit results with a command line switch. We can parse
this to get more detailed results than the returncode, and put those in
our own Junit output. We basically just throw away the top level
'testsuites' object, then fixup the names of the tests, and shove that
into our junit.
2020-05-04 11:33:19 -07:00
d61f7a1e84 Add regression test for libdir reset. 2020-05-04 18:12:44 +03:00
27bbf37cf0 Fix incremental debug builds in VS 2020-05-04 02:21:20 +03:00
fdd6022530 interpreter: Add link_language to all build targets
If the feature hadn't been broken in the first place it would have
worked on them anyway, so we might as well expose it. I'm loathe to do
it because one of the best features of meson in a mixed C/C++ code base
is that meson figures out the right linker every time, but there are
cases people have where they want to force a linker. We'll let them keep
the pieces.
2020-04-30 10:38:55 -07:00
650023f0cc unittests: Add test to show that link_language is broken 2020-04-30 10:38:55 -07:00
7b7f93a09f mtest: Generate a JUnit xml result file
JUnit is pretty ubiquitous, lots of services and results viewers
understand it, in particular gitlab and jenkins know how to consume
JUnit xml. This means projects using CI services can have their test
results consumed automatically.

Fixes: #6972
2020-04-23 13:26:01 -07:00
84f28fc3f1 Merge pull request #6816 from dcbaker/framework-matrix
project test junit schema + a few more uses
2020-04-21 00:37:34 +03:00
278c294aa4 Compiler options per lang
A current rather untyped storage of options is one of the things that
contributes to the options code being so complex. This takes a small
step in synching down by storing the compiler options in dicts per
language.

Future work might be replacing the langauge strings with an enum, and
defaultdict with a custom struct, just like `PerMachine` and
`MachineChoice`.
2020-04-20 23:23:15 +03:00
f798207a9a interpreter: Correctly ignore def files in build directory
See https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/85.
2020-04-17 22:02:41 +00:00
e0c9259e79 Add a json schema for the test.json used in tests
This does a couple of nice things, one is that editors like vscode can
be configured to use this schema to provide auto completion and error
highlighting if invalid values are added or required values are missing.
It also allows us test that the format of the test matrix work in a unit
test, which I've added. It does require that the python jsonschema
package is installed.
2020-04-17 10:49:09 -07:00
a6239d5100 wrap: Add fallback urls
It can happen that a server is temporaly down, tarballs often have
many mirrors available so we should be able to add at least one fallback
mirror in wrap files.
2020-04-13 13:29:33 +03:00
97a72a1c53 cmake: support cmake config file syntax (#6917)
* cmake: enhance support of cmake config file syntax

Enhance the cmakedefine support by accepting 2 or 3 tokens
in the conf line as mesondefine supports strictly 2 tokens

* fixup! cmake: enhance support of cmake config file syntax

* fixup! fixup! cmake: enhance support of cmake config file syntax
2020-04-10 11:14:54 -07:00
d20529784e Rename test dir names with dircondenser.py. 2020-04-05 22:51:47 +03:00
df5113252b qt dependency: Pick debug libraries based on b_vscrt
`b_vscrt` has existed forever, and is the canonical source for
which CRT to link to, and hence whether to use the debug libraries
or not.
2020-04-05 13:39:41 +03:00
7924e5f9c2 Revert "Naturally use env vars a bit more to match Autoconf"
This reverts commit 097dfc085e.
2020-03-23 18:07:24 +02:00
097dfc085e Naturally use env vars a bit more to match Autoconf
PR #6363 made it so our interpretation of env vars no longer clashed
with Autoconf's: if both Meson and Autoconf would read and env var, both
would do the same things with the value they read.

However, there were still cases that autoconf would read an env var when
meson wouldn't:

 - Autoconf would use `CC` in cross builds too

 - Autoconf would use `CC_FOR_BUILD` in native builds too.

There's no reason Meson can't also do this--if native cross files
overwrite rather than replace env vars, cross files can also overwrite
rather than replace env vars.

Because variables like `CC` are so ubiquitous, and because ignoring them
in cross builds just makes those builds liable to break (and things more
complicated in general), we bring Meson's behavior in line with
Autoconf's.
2020-03-23 17:51:36 +02:00
3a4388e51d Fix legacy env var support with cross
Fix #3969
2020-03-23 17:51:36 +02:00
f6b0425576 Fix linker evn var tests
Just because we are on windows doesn't mean we can use `link`.

This ought to be done better, but this will do for now.
2020-03-23 17:14:00 +02:00
1cf7799df2 Do not try to mix gcc with link.exe. 2020-03-22 22:48:47 +02:00
9074c7f8a4 envconfig: Make compiler and linker environment variables match 2020-03-17 10:40:39 -07:00
2ac480a0bd unittests: Add tests for overriding D linker language 2020-03-12 13:21:04 -07:00
0bb1e949e2 run_unittests: Use skip_if_not_language for linker tests
A couple used checks for specific compiler binaries, but those might not
be accurate for cross compiling. All the languages other than C and C++
(which we basically always assume we have) should have a
skip_if_not_lang check.
2020-03-12 13:21:04 -07:00
69e9d32bca coredata: Warn on usage of both -Dbuildtype and -Doptimization/-Ddebug
It may not be obvious to users that these two ways to set build-types
override each other and specifying both is redundant, and conflicts
are resolved based on whichever is specified later.

Closes https://github.com/mesonbuild/meson/issues/6742
2020-03-11 07:11:59 -04:00
bd953b6b29 coredata: Passing an option is supposed to set it, not flip the default
With the current logic passing `--debug` will actually be parsed as
`-Ddebug=false`, which is absolutely not what is expected.

There is no case in which the presence of a boolean option in `--foo`
form will mean 'I want feature foo disabled', regardless of the
*default* value of that option.

Also includes a test.

Closes https://github.com/mesonbuild/meson/issues/4686
2020-03-11 07:11:59 -04:00
c7aa4c8861 coredata: Set default options as cmdline args that override each other
The previous code was assuming that options do not depend on each
other, and that you can set defaults using `dict.setdefault()`. This
is not true for `buildtype` + `optimization`/`debug`, so we add
defaults + overrides in the right order and use the options parsing
code later to compute the values.

Includes a test.

Closes https://github.com/mesonbuild/meson/issues/6752
2020-03-11 07:11:59 -04:00
3a57e5177b Fix introspection of symlink targets on macOS. 2020-03-09 00:39:13 +02:00
44ff3e6c7d Merge pull request #6736 from dcbaker/mesonlib-type-annotations
Mesonlib type annotations
2020-03-08 14:49:23 +02:00
a16db4e918 update test_templates 2020-03-08 13:52:01 +02:00
5df106592c update test_templates to add dlang and find rust 2020-03-08 13:51:03 +02:00
4ce90bcb08 intro: List symlinks in installdata (fixes #6734) 2020-03-08 13:49:53 +02:00
d40c26e5fd override_dependency: Add failure tests 2020-03-06 15:26:02 -05:00