diff options
author | Niels Thykier <niels@thykier.net> | 2019-02-09 10:59:42 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2019-02-09 10:59:42 +0000 |
commit | c30a281d73af08266e394c08c5e3769840727121 (patch) | |
tree | 9691791459a7d249471a8fb411ede1313b3c242f /lib/Debian | |
parent | 7d4f23e73f377606db49e3ceda4e2ece370fa679 (diff) | |
download | debhelper-c30a281d73af08266e394c08c5e3769840727121.tar.gz |
meson: Dump meson-logs/testlog.txt on test error
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'lib/Debian')
-rw-r--r-- | lib/Debian/Debhelper/Buildsystem/meson.pm | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/lib/Debian/Debhelper/Buildsystem/meson.pm b/lib/Debian/Debhelper/Buildsystem/meson.pm index 316fe34b..e18d1112 100644 --- a/lib/Debian/Debhelper/Buildsystem/meson.pm +++ b/lib/Debian/Debhelper/Buildsystem/meson.pm @@ -108,20 +108,28 @@ 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', + eval { + 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(); } - ); - if ($this->get_parallel() > 0) { - $options{update_env}{MESON_TESTTHREADS} = $this->get_parallel(); + $this->doit_in_builddir(\%options, $this->{buildcmd}, "test", @_); + } + }; + if (my $err = $@) { + if (-e $this->get_buildpath("meson-logs/testlog.txt")) { + $this->doit_in_builddir('tail', '-v', '-n', '+0', 'meson-logs/testlog.txt'); } - $this->doit_in_builddir(\%options, $this->{buildcmd}, "test", @_); + die $err; } return 1; } |