summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2018-11-04 08:25:36 +0000
committerNiels Thykier <niels@thykier.net>2018-11-04 08:25:36 +0000
commit05d5284eec0a1f04732159e9fc6e83ecb0e0f505 (patch)
tree0857d63390848d624562865e4def16b0823f126c
parent3f7a4ead0463f3c250a329021d49f8815baf3121 (diff)
downloaddebhelper-05d5284eec0a1f04732159e9fc6e83ecb0e0f505.tar.gz
meson: Run tests with meson [c13]
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--debhelper.pod18
-rw-r--r--debian/changelog3
-rw-r--r--lib/Debian/Debhelper/Buildsystem/meson.pm24
3 files changed, 45 insertions, 0 deletions
diff --git a/debhelper.pod b/debhelper.pod
index c758a72b..0b0baefe 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -922,6 +922,24 @@ sequence by default.
=back
+=item v13
+
+This compatibility level is still open for development; use with caution.
+
+Changes from v12 are:
+
+=over 8
+
+=item -
+
+The B<meson+ninja> build system now uses B<meson test> instead of
+B<ninja test> when running the test suite. Any override of
+B<dh_auto_test> that passes extra parameters to upstream test runner
+should be reviewed as B<meson test> is not command line compatible
+with B<ninja test>.
+
+=back
+
=back
=head1 NOTES
diff --git a/debian/changelog b/debian/changelog
index f27d0cd0..8e92b326 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,9 @@ debhelper (11.5.2) UNRELEASED; urgency=medium
relations for.
* Dh_Lib.pm: Open compat level 13 as an experimental compat
level.
+ * meson.pm: In compat 13, run tests with "meson test" rather
+ than "ninja test". Thanks to Simon McVittie for the
+ suggestion. (Closes: #912560)
-- Niels Thykier <niels@thykier.net> Sat, 03 Nov 2018 08:02:02 +0000
diff --git a/lib/Debian/Debhelper/Buildsystem/meson.pm b/lib/Debian/Debhelper/Buildsystem/meson.pm
index a90fb703..316fe34b 100644
--- a/lib/Debian/Debhelper/Buildsystem/meson.pm
+++ b/lib/Debian/Debhelper/Buildsystem/meson.pm
@@ -104,4 +104,28 @@ sub configure {
}
}
+sub test {
+ my $this = shift;
+ my $target = $this->get_targetbuildsystem;
+
+ if (compat(12) or $target->name ne 'ninja') {
+ $target->test(@_);
+ } else {
+ # In compat 13 with meson+ninja, we prefer using "meson test"
+ # over "ninja test"
+ my %options = (
+ update_env => {
+ 'LC_ALL' => 'C.UTF-8',
+ }
+ );
+ if ($this->get_parallel() > 0) {
+ $options{update_env}{MESON_TESTTHREADS} = $this->get_parallel();
+ }
+ $this->doit_in_builddir(\%options, $this->{buildcmd}, "test", @_);
+ }
+ return 1;
+}
+
+
+
1