Commit Graph

14 Commits

Author SHA1 Message Date
Jehan c7c5f126b1 app: disable some unit tests temporarily.
Since the recent changes, these 3 tests are not working:
- tools
- session-2-8-compatibility-multi-window
- session-2-8-compatibility-single-window

(the 2 latters were only working with xvfb anyway)

I could just dig further as I did a bit these last few days, and tweak more and
more the testing code. But I think our current unit-testing framework is just
non-reliable and for all these years, we have spent more time fixing the tests
than actually relying on them to tell us there is a bug in GIMP.
Furthermore creating new tests is so cumbersome that basically none do it.

I have a plan laid out in #9339 for a much better and more reliable unit testing
infrastructure, based on the GIMP executable itself and a very simple syntax to
create new test scenari (so that even non-developers should be able to create
them eventually). So until then, let's disable these tests and stop wasting
time.
2023-04-12 22:07:09 +02:00
Jehan d4fb4362c9 app: fix unit tests with GUI.
Run them with the new GApplication logic, otherwise the various new
parts (such as actions) are not properly loaded.
2023-04-12 22:07:09 +02:00
Jacob Boerema f9217862cf app, tests: fix not running tools tests under meson
The meson build had the tools tests disabled unlike the autotools build.
Since enabling them doesn't cause any problems, let's enable them for
meson too.
2023-03-26 13:26:57 -04:00
Jacob Boerema a62cad35be app, meson: fix single window test failure
Our CI meson tests for single window failed even though the sessionrc
looked the same as the one created by the autotools tests.

Looking at the Makefile.am it explicitly states that the tests shouldn't
be run in parallel or in a different order than specified, which was not
the case in our meson build.

We change this by setting is_parallel to false for each build, and
setting a different priority for each test. Since higher priority values
execute first we count down.
2023-03-26 13:26:57 -04:00
Jordi Mallach 1aec2281f5 Increase the timeout of tests from default 30s to 60s.
Some slower architectures hit the timeouts and fail their build.

See
https://buildd.debian.org/status/fetch.php?pkg=gimp&arch=armel&ver=2.99.14-1&stamp=1669046159&raw=0
for an example of a failed build.
2022-11-22 10:01:44 +01:00
Jehan ca230cb770 meson: fix warnings of deprecated features.
Now that we bumped our meson requirement, meson is complaining about
several features now deprecated even in the minimum required meson
version:

s/meson.source_root/meson.project_source_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.

s/meson.build_root/meson.project_build_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.

Fixing using path() on xdg_email and python ExternalProgram variables:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead

s/get_pkgconfig_variable *(\([^)]*\))/get_variable(pkgconfig: \1)/ to
fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
2022-08-31 01:29:37 +02:00
Jehan 2ac483f9e3 meson: make run_command() calls future-proof.
Some of our calls to run_command() would have failed with future
versions of meson if we didn't set the "check" parameter. In particular,
in various calls, we don't want to fail the whole build configuration
when the command does (as it's an optional feature check). In such a
case, it is important to be explicit as future will default to fail
then.

Fixes:

> WARNING: You should add the boolean check kwarg to the run_command call.
>          It currently defaults to false,
>          but it will default to true in future releases of meson.
>          See also: https://github.com/mesonbuild/meson/issues/9300
2022-07-31 18:23:00 +02:00
Jehan ec26bc44ae app: (meson) create_test_env.sh was not run.
The script `create_test_env.sh` was registered in meson as a run target
(i.e. to be run manually by `ninja create_test_env`), which is really
not useful. So a `ninja test` was outputting various:

> You have a writable data folder configured (/gimp/build/dir/app/tests/gimpdir-output/gradients),
> but this folder does not exist. Please create the folder or fix your
> configuration in the Preferences dialog's 'Folders' section.

Unfortunately run target are only meant to be run from command lines and
cannot be used in 'depends' argument of test() or 'dependencies' of
executable() because "in Meson all dependencies are to output files, not
to concepts" (cf. https://github.com/mesonbuild/meson/issues/1793).

So instead a run_target() just directly use a run_command() and make
this script run during configuration step. Also make the shell script
executable as it was not.

See also #5666 as it was one of the errors outputted by the reporter's
log (though probably not the main issue).
2020-09-20 13:20:29 +02:00
Niels De Graef 0352559efa meson: Allow running tests headless
This commit makes sure we can properly run the tests in a headless
environment, i.e. they don't mess with the user's X display or their
session bus. The latter is also needed for parallel tests as they fail
to simultaneously own the same name on the session bus.

Replaced the "xvfb-run" meson option with the "headless" option, which
is more intuitive (and also more correct, since we now also require
`dbus-run-session` to run the tests, not only `xvfb-run`).

Finally, note that we need a version of `xvfb-run` that supports the
`-d` (`--auto-display`) option. The problem with `--auto-servernum`
which is also regularly used, is that it doesn't shut down cleanly,
returning a non-zero exit code, wich makes the test fail.

Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/5078
2020-05-14 18:31:08 +02:00
Niels De Graef ddfae277cb meson: Cleanup and fix issues using libapp_dep
Meson has a very useful tool for combining a set of linked libraries and
compiler arguments (like an internal pkg-config):
`declare_dependency()`. Use this command to ensure that we can easily
reuse libapp* over multiple libraries, executables and tests.

That way, if we also add a new dependency later on in one of the libapp
libraries, this won't need to be added multiple times.
2020-05-11 10:52:23 +00:00
Niels De Graef 5f117d0561 meson: Fix envvar in tests
`GIMP_TESTING_ABS_TOP_SRCDIR` is supposed to point to the top source root directory, not the top build directory.
2020-05-11 10:52:23 +00:00
Niels De Graef 3a167243b9 meson: Fix building of tests
The tests weren't building because they weren't linked to the static
libraries.

Note that some tests still need fixing, but at least they can be
built/run now.
2020-05-11 10:52:22 +00:00
Jehan 9a043d0fc9 Issue #4251: (meson) dbus-glib-1 not required.
As written in previous commit, this is not a dependency since commit
c4460e84.
2019-11-16 19:26:58 +01:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00