Commit Graph

454 Commits

Author SHA1 Message Date
Eli Schwartz 7126ca6e27
tests: remove unnecessary non-meson syntax from meson.build
We don't use parentheses for the if function, because it's not a
function.
2023-06-07 16:40:52 -04:00
Eli Schwartz e2e6fd2e61
tests: update llvm version exclusions for hopefully the last time
This is now fixed upstream and expected to be backported to the next
point release.
2023-06-07 16:40:52 -04:00
Eli Schwartz 95ee4d7d13
tests: be DRY in llvm framework test
It's a lot more readable to not repeat big arrays.
2023-06-07 16:40:52 -04:00
Eli Schwartz 96f6600832
tests: avoid hard to debug error when llvm is found with only one method
In commit 89146e84c9 we added some
complicated code to verify the llvm framework's "combination" matrix
lookup. It expects to find llvm with both cmake and config-tool, with
the same version. But the sanity check is wonky -- it checks that both
have the same found status, instead, so if both are not found then we
proceed to try to convert the string "unknown" to a mapping of semver
integers, and this is guaranteed to fail.

This can happen for example if the system llvm exists in the general
case, but actual modules cannot be found because the system llvm does
not distribute static modules. For example, this is the case on Gentoo.

Abort more obviously by just insisting that both be found. If they
aren't both found, then investigative efforts know to look at why they
weren't found.
2023-06-07 16:40:51 -04:00
Nirbheek Chauhan aee1bb2081 llvm: Bump broken micro version for CI
16.0.4 didn't fix the LLVM breakage.
2023-05-23 18:24:08 -04:00
Nirbheek Chauhan 22df45a319 qt: Allow specifying separate tools for qt4/5/6
Currently you can only use one of qt4, qt5, qt6 in a single project
when using a machine file because the config-tool lookup for qt only
looks at `qmake` in the machine files, instead of looking up the
binary names directly.

Allow specifying `qmake` `qmake4` `qmake5` and `qmake6`.

This is necessary for gstreamer, which can build separate qt5 and qt6
plugins that are distributed as static libraries, so the user can pick
which one to use.
2023-05-23 18:24:08 -04:00
Volker Weißmann 38b35eca30 Add env kwarg to gnome.generate_gir().
Fixes #384
2023-04-26 14:51:10 -04:00
Nirbheek Chauhan 9cc5009a44 ci: Don't search for llvm modules with LLVM 16.0.x
See: https://github.com/mesonbuild/meson/issues/11642
2023-04-24 11:42:40 -04:00
Matthieu Bouron 09ec4f6e22 dependencies: allow to fallback on CMake to find the SDL2 library
On Windows, the SDL2 library is generally provided with only CMake config
files. This commit allows meson to fallback on CMake as a last resort to
find the SDL2 library.
2023-04-24 11:41:55 -04:00
Josh Soref cf9fd56bc9 fix various spelling issues
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-11 19:21:05 -04:00
Eli Schwartz b3b57342ef
tests: fix critical existence failure of doxygen test
It was totally subproject-unsafe, and setting a super bad example. This
is bad, because doxygen is annoying to get right and we occasionally
tell people to go use our example test case.

There is a fun nuance here, that makes doxygen unpredictably work on
some versions, and fail on others. Specifically, values must be quoted
in doxygen 1.8, but not in doxygen 1.9, or they break -- but only if the
output directory contains spaces. This was "fixed" in commit

ef91bacb7a

which actually caused it to act like an unquoted OUTPUT_DIRECTORY is not
provided at all, and then fixed for real in commit

eb3d1eb5ad

For portability, it is necessary to quote this just to be on the safe
side.

Fixes #11579
2023-03-26 00:37:39 -04:00
Eli Schwartz e0b63d539e add a CI runner testing that Meson runs correctly under PyPy3
Silence a couple of framework tests that need to be skipped since we
don't install their dependencies for pypy3.
2023-02-13 09:09:10 -05:00
Eli Schwartz 66740b4ce1
CI: skip gpgme-config test on Arch
gpgme has decided that config-tool is bad, which makes sense. They've
also decided that they will only install theirs, if gpg-error also
installs one, which is a bit... confusing. Anyway, it's impossible to
know whether it should or should not exist, so just accept that this
test is ready to be skipped on distros that currently no longer have
this ancient config-tool script.

Victory is within reach!
2023-02-08 18:52:27 -05:00
Konstantin 92ac0e48e5 tests/llvm: require cmake 3.11
This is a weird but working way to skip this test from running on
bionic (where it should not run).
2023-01-28 20:16:06 +01:00
Konstantin 89146e84c9 cmake: allow dynamic linking with LLVM
llvm-config is unsuitable for standard cross-compile,
because we need to build llvm especially for it, which
is not done is almost any distros, so, for example,
standard bootstrap chroot will be unsuitable.

This patch is trying to acheive feature parity between
config-tool searching of LLVM and CMake-based one,
which is arch-agnostic.

Signed-off-by: Konstantin <ria.freelander@gmail.com>
2023-01-28 20:16:06 +01:00
Eli Schwartz 5bea2ca198 CI: skip libgcrypt test on msys2
This is no longer implicitly installed due to libxslt. Actually though,
we don't need to test this in order to ensure that the custom dependency
works -- we have other jobs that test it, and the config-tool handling
itself won't suddenly fail on msys2 specifically.
2022-12-11 22:43:31 +02:00
Eli Schwartz 174e05d0f6
tests: fix qt project test when running with qt4
*.qrc files converted to C++ sources could make use of Qt headers, and
in practice for qt4 they seem to. Since this is Qt code to begin with,
it makes sense to depend on the Qt being targeted regardless of version.
2022-11-17 19:10:51 -05:00
Paolo Bonzini 212af2b278 gnome: allow generator outputs as gdbus-codegen inputs
GeneratedLists as sources to `gnome.gdbus_codegen` worked until
version 0.60 of Meson, but broke in 0.61 because of the conversion to
typed_pos_args and typed_kwargs.  Reinstate this by adding them to the
decorators and annotations.

Note that gdbus_codegen desugars to two custom_targets and therefore the
generator is invoked twice.  This is not optimal, but it should not be
an issue and can be changed later.

Fixes: 53a187ba2 ("modules/gnome: use typed_pos_args for gdbus_codegen", 2021-11-01)
Fixes: ef52e6093 ("modules/gnome: use typed_kwargs for gdbus_codegen", 2021-11-08)
2022-10-28 13:06:52 +03:00
Paolo Bonzini 2fe3271f77 gnome: allow custom targets as gdbus-codegen inputs
Custom targets as sources to `gnome.gdbus_codegen` worked until version 0.60
of Meson, but broke in 0.61 because of the conversion to typed_pos_args
and typed_kwargs.  Reinstate this by adding custom targets to the
decorators and annotations.

While generators also used to work, they are a bit tricky because
gdbus_codegen desugars to two custom_targets and therefore the generator
is invoked twice.  This should not be a problem, but be explicit and
leave that to a separate commit to highlight the problem.

Fixes: 53a187ba2 ("modules/gnome: use typed_pos_args for gdbus_codegen", 2021-11-01)
Fixes: ef52e6093 ("modules/gnome: use typed_kwargs for gdbus_codegen", 2021-11-08)
2022-10-28 13:06:52 +03:00
Jan Alexander Steffens (heftig) d682d3f837 Add missing cdata update in genmarshal tests
Otherwise the test is flaky, as it may try to include a header that's
not generated yet.
2022-09-04 00:07:34 -04:00
Nirbheek Chauhan f70895a441 tests/7 gnome: Fix incorrect unref of GResource
The returned GResource is transfer-none, since the generated function
basically calls g_static_resource_get_resource(). It should not be
unreffed. Causes an abort on Debian:

GLib-GIO:ERROR:../../../gio/gresource.c:1451:g_static_resource_fini: assertion failed: (g_atomic_int_get (&resource->ref_count) >= 2)
2022-09-03 20:12:35 +03:00
Dylan Baker 6d50fadde5 tests: fix targets with no sources
This was never supposed to be possible, so stop doing it.
2022-08-17 13:44:08 -07:00
Eli Schwartz ea952966b4
update gnome test to cover built gresource files
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2022-06-19 10:47:47 -04:00
Eli Schwartz e223136b10
qt dependency: find the correct -qtX configtool name
Fixes regression in commit c211fea513. The
original dependency lookup looked for `qmake-{self.name}`, i.e.
`qmake-qt5`, but when porting to config-tool, it got switched to
`qmake-{self.qtname}` i.e. `qmake-Qt6`, which was bogus and never
worked. As a result, if `qmake-qt5` and `qmake` both existed, and the
latter was NOT qt5, it would only try the less preferred name, and then
fail.

We need to define self.name early enough to define the configtool names,
which means we need to set it before running the configtool __init__()
even though configtool/pkgconfig would also set it to the same value.

Mark the tests as passing on two distros that were failing to detect
qmake due to this issue, and were marked for skipping because we assumed
that the CI skipping there was an expected case rather than an old
regression.
2022-04-12 20:44:07 -04:00
Stefan Hajnoczi b956d74175 tests: fix incomplete Qt 6 support
The "frameworks/4 qt" test covers Qt 4 and 5. There is already Qt 6 code
in the test but it is incomplete because translations are missing and Qt
6 requires C++17 or later to compile.
2022-04-12 20:42:42 -04:00
Jan Tojnar b7686dfed5 gnome: Fix gtkdoc when using multiple Apple frameworks
The `-framework Foundation -framework CoreFoundation` ended up
de-duplicated by OrderedSet into `-framework Foundation CoreFoundation`.
2022-03-29 12:52:55 -04:00
Eli Schwartz e67fd1f551
i18n module: fix bug that made msgfmthelper die on combinations of args
Due to misuse of argparse in commit 82492f5d76
it was impossible to use both --datadirs and extra args passed directly
to msgfmt at the same time.

I'm not sure anyone actually knows how argparse works, so misusing it is
easy. What is definitely known is that argparse is NOT a POSIX compliant
parser and doesn't behave the way you'd expect a standards based parser
to handle options. Instead it caters to the easy use case, and hopes and
prays you don't need to do anything too complicated "with the wrong kind
of complicated".

Apparently, this particular type of complicated is when you have mixed
option_arguments and operands while simultaneously passing some operands
as nargs after a --.

It totally breaks, and interprets --datadirs, which is supposed to be an
option_argument, as an operand, eats it up as a msgfmt wrapped argument,
and breaks.

But if you don't pass additional arguments with -- then it interprets
--datadirs after operands as an option_argument. This is what we were
doing.

Instead pass option_arguments before all operands (including the ones
specified via `-- ...`). Add test case to pass meaningless datadirs (we
don't actually care if $GETTEXTDATADIRS is set to something that doesn't
contain gettext data).
2022-03-06 10:48:34 -05:00
Dylan Baker 5d31735c1e modules/gnome: Allow gdbus_annotations to take an empty list again
This was allows up to 0.61.0 (including with the initial type
annotations), but was accidentally broken by fixes for other bugs in
0.61.1.

Fixes: #9883
2022-01-27 17:22:41 -05:00
Jussi Pakkanen 4316b71017
Merge pull request #9742 from ximion/wip/itstool
i18n: Add support for joining XML localization via itstool
2022-01-22 01:01:29 +02:00
Matthias Klumpp 02fb0c3f8b i18n: Add support for joining XML localization via itstool 2022-01-21 22:26:17 +01:00
Eli Schwartz 96d0005744 gnome.genmarshal: restore the ability to pass sources as Files objects
It used to support:
- a single string
- an array of anything

And as long as CustomTarget supported it too, everything worked fine.
So, a `files('foo')` worked but a `files('foo')[0]` did not, which is
silly... and it's not exactly terrible to use files() here, the input is
literally a list of source files.

Fixes building gnome-terminal
Fixes #9827

Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
2022-01-15 23:50:14 +05:30
Nirbheek Chauhan f35e2fcb3e tests: Add a partial test for gtk_doc check: kwarg
check: true is needed for an actual regression test, but that requires
a pedantically correct gtk-doc configuration, which I attempted to do
and failed. So let's just put check: false so we get *some* coverage:
just that typed_kwargs accepts the argument.

Related to https://github.com/mesonbuild/meson/pull/9807
2022-01-15 00:38:14 +05:30
Nirbheek Chauhan ca0c757770 tests: Add regression tests for gdbus_codegen args
https://github.com/mesonbuild/meson/pull/9812
2022-01-15 00:38:14 +05:30
Nirbheek Chauhan 23bc0e6422 tests: Add a regression test for gtk-doc arguments
gobject_typesfile
html_assets

https://github.com/mesonbuild/meson/pull/9807
2022-01-15 00:38:14 +05:30
Pablo Correa Gómez 270843ed34
test cases/frameworks/13 yelp: Do not reuse sources files
Additionally reorder test.json for better readability
2022-01-02 00:34:49 -05:00
Eli Schwartz bc8c938148
gnome module: deprecate passing false to install_dir_gir
Use a proper install option for this. Now `install_<type>` can directly
override `install` instead of passing a boolean to the string kwarg
`install_dir_<type>`.
2021-12-06 20:59:45 -05:00
Eli Schwartz bed55a902c
gnome module: document and fix install_dir x3, by allowing false *_gir and *_typelib
generate_gir forces building both the typelib and gir, and some people
only want one or the other (probably only the typelib?) which means
flagging the other as install_dir: false in the same way custom_target
supports.

As this always worked, albeit undocumented, make sure it keeps working.
It's pretty reasonable to allow, anyway.

Fixes https://github.com/mesonbuild/meson/pull/9484#issuecomment-980131791
2021-12-06 20:07:43 -05:00
Jon Turney 987a26e9e1 Update expected skip condition for llvm framework test on msys2
On msys2, we will now find static llvm using cmake
2021-11-20 08:29:50 -08:00
Volker Weißmann 2c079d855e Added warning if run_command is called without the check kwarg 2021-10-30 22:26:28 -04:00
Dylan Baker ae35b1f45a modules/gnome: ensure that `install_dir` is set
The `mkenums` functions can have this unset if, and only if, the
c file only variant is called. Due to side effects if the header file is
generated then `install_dir` is ensured to be set for the c file. I have
removed this side effect so that our tests actually cover this case.

Fixes #9472
2021-10-27 20:50:29 -04:00
makise-homura fc3de287cb unittests: Make qt test work if multiple versions of qt installed 2021-09-29 20:16:02 -07:00
Eli Schwartz ad3bf77ff0
add test case for qrc translations 2021-09-10 17:57:28 -04:00
Dylan Baker 4d7031437c pylint: turn on superflous-parens
We have a lot of these. Some of them are harmless, if unidiomatic, such
as `if (condition)`, others are potentially dangerous `assert(...)`, as
`assert(condtion)` works as expected, but `assert(condition, message)`
will result in an assertion that never triggers, as what you're actually
asserting is `bool(tuple[2])`, which will always be true.
2021-08-31 16:28:54 -04:00
Xavier Claessens 88a1bed81b decorators: Make unknown kwarg fatal 2021-08-30 14:00:54 -04:00
Kevin Meagher 39a92c74e8 Test boost-python on macOS
Previously the meson test case would only test boost-python on linux.
With the #7909 it is now possible to use boost-python on macOS/homebrew.
This enables the boost-python test on both linux and macOS.
It also uses python.extension_module() instead of shared_library to make the
python extension module.
2021-08-18 22:07:27 +03:00
Eli Schwartz 59d4f771d2
editorconfig: add setting to trim trailing whitespace
and clean up all outstanding issues

Skip 'test cases/common/141 special characters/meson.build' since it
intentionally uses trailing newlines.
2021-08-15 09:36:18 -04:00
Jussi Pakkanen 9ab12ca85e Force unity builds off in Flex test. 2021-08-14 21:32:54 +03:00
Jussi Pakkanen 8f5e1649aa Pass a test file to flex test. 2021-08-12 01:53:20 +03:00
Adrien Plazas 042adba204 Make the flex test case work
This adds the noyywrap option so flex doesn't wait for more input once
we reached EOF. This also adds the nounput and noinput options to fix
compilation warnings.

We can now run the test as expected.
2021-08-11 21:47:53 +03:00
Xavier Claessens 223991c09e Fix i18n target name when using @BASENAME@ and configure_file() input
Fixes: #9022
2021-08-09 19:43:45 -04:00