Commit Graph

811 Commits

Author SHA1 Message Date
James Hilliard 1ce4258c21 backends: fix rpath match pattern
Since -Wl,-rpath= is not the only valid rpath ldflags syntax we
need to try and match all valid rpath ldflags.

In addition we should prevent -Wl,--just-symbols from being used to
set rpath due to inconsistent compiler support.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-07-30 16:36:11 +03:00
Marcel Hollerbach 903d5dd8a7 ninjabackend: check if target has compiler attribute
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-28 17:59:03 +03:00
Jussi Pakkanen 18aff92d7a
Merge pull request #7461 from mensinda/noMoreSetuptools
Remove the setuptools dependency with mesondata.py
2020-07-23 13:01:29 +03:00
Xavier Claessens 7f1e9b7492 summary: Wrap lines when printing lists
When a list_sep is provided (e.g. ', ') all items are printed on the
same line, which gets ugly on very long lists (e.g. list of plugins
enabled).
2020-07-21 07:30:37 +00:00
Jussi Pakkanen 804a71e8f2 Do not add rpaths for static libs. Closes #5191. 2020-07-20 14:14:49 +00:00
Daniel Mensinger 393d6e133d
mdata: Add test to ensure mesondata.py is up-to-date 2020-07-16 21:03:23 +02:00
Jussi Pakkanen fa929b4714 Check that hg is actually working. 2020-07-12 00:07:26 +03:00
Jussi Pakkanen a296ee44a1 Skip doc test when docs are not available. 2020-07-02 20:02:50 +03:00
Xavier Claessens 56c9e95b04 Implicit dependency fallback when a subproject wrap or dir exists 2020-07-01 09:45:33 -04:00
TheQwertiest b6981bd16e
Made Commands.md dynamically generated (#7346) 2020-06-30 23:56:08 +03:00
Xavier Claessens 4a371c97f4 wrap: Apply patch even in VCS cases 2020-06-30 19:42:43 +03:00
Xavier Claessens 1c8731a100 envconfig: Add [constants] section in machine files
Machine files already supports `+` operator as an implementation detail,
since it's using eval(). Now make it an officially supported feature and
add a way to define constants that are used while evaluating an entry
value.
2020-06-29 20:16:21 +03:00
TheQwertiest 5696a5abba Added ability to specify target in `meson compile` 2020-06-29 19:54:38 +03:00
TheQwertiest 4d0233540f Added ability to pass arguments to backend in `meson compile` 2020-06-28 18:13:49 -04:00
Xavier Claessens d0f468fef1 pkgconfig: Add missing cflags in uninstalled files
Fixes: #7365
2020-06-24 22:53:09 +03:00
Alan Coopersmith feef5a1c06 unittests: Fix 51 ldflagdedup on Solaris
If the linker doesn't support --export-dynamic, skip test to deduplicate
it, since it always fails finding 0 copies instead of 1.
2020-06-22 15:01:45 -07:00
Alan Coopersmith e06b04dc80 unittests: Fix test_compiler_detection on Solaris
Accept Solaris linker in addition to GNU linker.  Previously using the
system provided gcc (which calls the Solaris linker) caused it to fail with:

======================================================================
FAIL: test_compiler_detection (__main__.AllPlatformTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "run_unittests.py", line 2525, in test_compiler_detection
    self.assertIsInstance(cc.linker, mesonbuild.linkers.GnuLikeDynamicLinkerMixin)
AssertionError: <SolarisDynamicLinker: v9.2.0 `gcc`> is not an instance of <class 'mesonbuild.linkers.GnuLikeDynamicLinkerMixin'>

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-22 15:00:27 -07:00
Dylan Baker 93c3ec7e2d compilers: Return CompilerArgs from compiler instance
Since the CompileArgs class already needs to know about the compiler,
and we really need at least per-lanaguage if not per-compiler
CompilerArgs classes, let's get the CompilerArgs instance from the
compiler using a method.
2020-06-22 12:06:10 -07:00
Dylan Baker 9d0ad66c29 compilers: Split CompilerArgs into a separate module
I've also moved this out of the compilers pacakge because we're soon
going to need it in linkers, and that creates some serious spagetti
2020-06-22 12:06:10 -07:00
Cary Converse 8620ca2066 disable coverage tests on msys2 2020-06-17 23:08:51 -04:00
Cary Converse a198e5d191 coverage: llvm-cov support 2020-06-17 23:02:50 -04:00
Mathieu Duponchelle 20709af4d2 interpreter: add support for --force-fallback-for
This new command line option allows specifying dependencies for
which to force fallback.

See the documentation for more information

Fixes: #7218
2020-06-16 13:45:40 -04:00
Michael Hirsch 6f2eb6233c pep8: add missing import, remove unused variable 2020-06-15 23:33:40 +03:00
Michael Hirsch 1ec84c570f run_*tests*.py: print Meson version at start of test suite
on some systems, tests may take over an hour to run--only to find
you might have used an unintended Meson version (e.g. release instead
of dev). This change prints the Meson version at the start of the
run_*tests*.py scripts.

Also, raise SystemExit(main()) is preferred in general over
sys.exit(main())
2020-06-15 23:33:40 +03:00
Michael Hirsch 0b9e8e39dd environment: fallback regex for versions like 2020.01
add four-digit version unit_test cases
2020-06-15 10:06:34 -07:00
TheQwertiest 399303b534
Added docs for all meson commands + corresponding unit test (#7217) 2020-06-15 11:20:20 +05:30
Nirbheek Chauhan 63f1b5bb70 unit tests: Pass args to pytest
Gets --help working and --failfast too.
2020-06-11 07:10:43 +00:00
Marcel Hollerbach 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
Dan Kegel 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
Daniel Mensinger 210b57a136
ast: add unittest 2020-05-23 18:13:25 +02:00
Jussi Pakkanen 2b1ca518cf
Merge pull request #7123 from dcbaker/use-feature-deprecated
Use FeatureDeprecated (and other cleanups)
2020-05-22 17:08:44 +03:00
Jussi Pakkanen 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
Jussi Pakkanen b4b1a2c5a1 Build private directory name from output file name. 2020-05-19 00:22:45 +03:00
Dylan Baker 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
Dylan Baker 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
Dylan Baker 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
Dylan Baker 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
Dylan Baker 88f4bc6b55 run_unittests: move cross_file_system_paths to the cross tests 2020-05-18 13:53:58 -07:00
Jussi Pakkanen 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
Dan Kegel f8cfb74e9b Let LDFLAGS specify rpath.
Fixes #2567
2020-05-16 20:26:03 +00:00
Dan Kegel d7235c5905 Let .pc files specify rpath.
Fixes #4027
2020-05-16 20:25:58 +00:00
Dylan Baker cb4e4f625f run_unittests: Use unittest.mock instead of a handrolled mock 2020-05-14 12:15:03 -07:00
Nirbheek Chauhan 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
Eric Lemanissier ab6a410426 macos: Remove framwork linkerlike args
fixes-up 33fbc548ab
2020-05-13 15:55:07 +00:00
Jussi Pakkanen 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
Dylan Baker 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
Jussi Pakkanen d61f7a1e84 Add regression test for libdir reset. 2020-05-04 18:12:44 +03:00
GustavoLCR 27bbf37cf0
Fix incremental debug builds in VS 2020-05-04 02:21:20 +03:00
Dylan Baker 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
Dylan Baker 650023f0cc unittests: Add test to show that link_language is broken 2020-04-30 10:38:55 -07:00