After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786497 - Have 'meson test' run unit tests
Have 'meson test' run unit tests
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.25.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 786343
Blocks:
 
 
Reported: 2017-08-19 04:17 UTC by Jeremy Bicha
Modified: 2017-10-04 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Run unit tests on `meson test` (2.25 KB, patch)
2017-08-19 10:10 UTC, Florian Müllner
none Details | Review
build: Run unit tests on `meson test` (1.99 KB, patch)
2017-09-22 16:55 UTC, Florian Müllner
committed Details | Review

Description Jeremy Bicha 2017-08-19 04:17:17 UTC
gnome-shell master

$ ninja -C builddir test
ninja: Entering directory `builddir'
[0/1] Running all tests.
No tests defined.

I would like to see 'meson test' run the unit tests.

In Ubuntu, I was running the unit tests as part of the gnome-shell package build with a command like this

GSETTINGS_SCHEMA_DIR=builddir/data xvfb-run builddir/tests/run-test.sh -v tests/unit/*.js

But now I get this error:
(run-js-test:23807): GLib-GIO-ERROR **: Settings schema 'org.gnome.shell' is not installed

The GSETTINGS_SCHEMA_DIR variable worked with 3.24 but I don't know why it's not working here.
Comment 1 Florian Müllner 2017-08-19 10:10:03 UTC
Created attachment 357968 [details] [review]
build: Run unit tests on `meson test`

Meson makes it easy to define unit tests, so hook up the existing
ones.
Comment 2 Jeremy Bicha 2017-08-19 12:30:16 UTC
Thanks, but gnome-shell doesn't build for me with the patch.

$ meson builddir
(skip lines…)

Configuring org.gnome.shell.gschema.xml using configuration
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Configuring run-test.sh using configuration

Meson encountered an error in file tests/meson.build, line 13, column 0:
Second argument must be executable.
Comment 3 Florian Müllner 2017-08-19 13:33:50 UTC
Works with 0.42.0 here - presumably there was some fix to accept configure_file() output as executable at some point.
Comment 4 Jeremy Bicha 2017-08-19 16:49:01 UTC
(In reply to Florian Müllner from comment #3)
> Works with 0.42.0 here - presumably there was some fix to accept
> configure_file() output as executable at some point.

Thanks! It works well after I updated meson to 0.42.0.
Comment 5 Florian Müllner 2017-09-22 16:55:09 UTC
Created attachment 360275 [details] [review]
build: Run unit tests on `meson test`

Cut down on some code duplication
Comment 6 Florian Müllner 2017-10-04 16:29:02 UTC
Attachment 360275 [details] pushed as 4543ca1 - build: Run unit tests on `meson test`