Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 680010 - meson.eclass: meson_src_test output is not verbose
Summary: meson.eclass: meson_src_test output is not verbose
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-11 07:41 UTC by Mart Raudsepp
Modified: 2019-06-02 16:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
meson-fix-tests.patch (meson-fix-tests.patch,359 bytes, patch)
2019-03-30 18:33 UTC, William Hubbs
Details | Diff
meson-fix-tests.patch (meson-fix-tests.patch,924 bytes, patch)
2019-03-30 19:48 UTC, William Hubbs
Details | Diff
0001-meson.eclass-fix-tests.patch (0001-meson.eclass-fix-tests.patch,2.01 KB, patch)
2019-03-31 18:33 UTC, William Hubbs
Details | Diff
0001-meson.eclass-fix-tests.patch (0001-meson.eclass-fix-tests.patch,2.00 KB, text/plain)
2019-05-27 19:38 UTC, William Hubbs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mart Raudsepp gentoo-dev 2019-03-11 07:41:10 UTC
Relying on meson_src_test may end up with limited src_test output in build log.

Compare e.g. x11-libs/gdk-pixbuf with current meson_src_test outputs:
>>> Test phase: x11-libs/gdk-pixbuf-2.38.1
 * abi_x86_64.amd64: running multilib-minimal_abi_src_test
ninja -v -j7 -l15 -C /tmp/portage/x11-libs/gdk-pixbuf-2.38.1/work/gdk-pixbuf-2.38.1-abi_x86_64.amd64 test
ninja: Entering directory `/tmp/portage/x11-libs/gdk-pixbuf-2.38.1/work/gdk-pixbuf-2.38.1-abi_x86_64.amd64'
[0/1] /usr/lib64/python-exec/python3.6/meson test --no-rebuild --print-errorlogs
 1/22 gdk-pixbuf:format / animation           OK       0.04 s 
 2/22 gdk-pixbuf:security / cve-2015-4491     OK       0.93 s 
 3/22 gdk-pixbuf:conform+slow / pixbuf-fail   OK       3.26 s 
 4/22 gdk-pixbuf:conform / pixbuf-icon-serialize  OK       0.05 s 
 5/22 gdk-pixbuf:slow / pixbuf-randomly-modified  OK       1.72 s 
 6/22 gdk-pixbuf:io / pixbuf-threads          OK       0.06 s 
 7/22 gdk-pixbuf:io / pixbuf-gif              OK       0.13 s 
 8/22 gdk-pixbuf:io / pixbuf-icc              OK       0.04 s 
 9/22 gdk-pixbuf:format / pixbuf-jpeg         OK       0.05 s 
10/22 gdk-pixbuf:io / pixbuf-dpi              OK       0.03 s 
11/22 gdk-pixbuf:format / pixbuf-pixdata      OK       0.03 s 
12/22 gdk-pixbuf:io / pixbuf-stream           OK       0.03 s 
13/22 gdk-pixbuf:conform / pixbuf-reftest     OK       0.40 s 
14/22 gdk-pixbuf:io / pixbuf-resource         OK       0.02 s 
15/22 gdk-pixbuf:ops / pixbuf-scale           OK       0.10 s 
16/22 gdk-pixbuf:ops / pixbuf-scale-two-step  OK       0.14 s 
17/22 gdk-pixbuf:format / pixbuf-short-gif-write  OK       0.11 s 
18/22 gdk-pixbuf:format / pixbuf-gif-circular-table  OK       0.04 s 
19/22 gdk-pixbuf:io / pixbuf-save             OK       0.03 s 
20/22 gdk-pixbuf:conform / pixbuf-readonly-to-mutable  OK       0.02 s 
21/22 gdk-pixbuf:ops / pixbuf-composite       OK       0.02 s 
22/22 gdk-pixbuf:slow / pixbuf-area-updated   OK      78.99 s 

OK:        22
FAIL:       0
SKIP:       0
TIMEOUT:    0

Full log written to /tmp/portage/x11-libs/gdk-pixbuf-2.38.1/work/gdk-pixbuf-2.38.1-abi_x86_64.amd64/meson-logs/testlog.txt
>>> Completed testing x11-libs/gdk-pixbuf-2.38.1


while
meson test -C ${BUILD_DIR} -v || die "tests failed"
outputs:

>>> Test phase: x11-libs/gdk-pixbuf-2.38.1
 * abi_x86_64.amd64: running multilib-minimal_abi_src_test
ninja: Entering directory `/tmp/portage/x11-libs/gdk-pixbuf-2.38.1/work/gdk-pixbuf-2.38.1-abi_x86_64.amd64'
ninja: no work to do.
# random seed: R02S142359ca28b763c450b4064c40ff9286
1..2
# Start of animation tests
ok 1 /animation/gif
ok 2 /animation/ani
# End of animation tests
<snip>
20/22 gdk-pixbuf:conform / pixbuf-readonly-to-mutable  OK       0.03 s 
21/22 gdk-pixbuf:ops / pixbuf-composite       OK       0.05 s 
22/22 gdk-pixbuf:slow / pixbuf-area-updated   OK      78.35 s 

OK:        22
FAIL:       0
SKIP:       0
TIMEOUT:    0

>>> Completed testing x11-libs/gdk-pixbuf-2.38.1


I guess with the <snip> it's harder to see, but it's much more verbose, and the small version only is outputted after all is done too, it seems, so don't even see all the tests but (very slow) last are done until all are done.

I suspect my meson test -C ${BUILD_DIR} -v is not ideal in that it probably ignored MAKEOPTS, so this is a bug report, not patch :(

An additional issue is that meson_src_test can't be combined with running other programs, so then direct meson test or eninja calls are also needed, thus potentially also ending up ignoring MAKEOPTS due to ebuild not taking care of that. This is a common problem when tests need to be wrapped inside dbus-run-session; and things get even more complicated if virtx needs to be involved too.
Comment 1 William Hubbs gentoo-dev 2019-03-30 18:33:39 UTC
Created attachment 571290 [details, diff]
meson-fix-tests.patch

What happens if you apply this patch to meson.eclass?
This changes the way we run tests to use the meson test command.
Comment 2 William Hubbs gentoo-dev 2019-03-30 19:48:50 UTC
Created attachment 571292 [details, diff]
meson-fix-tests.patch

This is an updated version which adds an emesontestargs variable which
behaves like emesonargs.
Comment 3 Mike Gilbert gentoo-dev 2019-03-31 01:41:37 UTC
Please don't add more variables like "emesontestargs". Just pass "$@" instead.

Also, you have not quoted the variables correctly.
Comment 4 Mike Gilbert gentoo-dev 2019-03-31 17:58:49 UTC
(In reply to Mike Gilbert from comment #3)
> Please don't add more variables like "emesontestargs". Just pass "$@"
> instead.

I see cmake-utils has myctestargs, so I guess this is somewhat common. Let's just support both the variable and "$@".
Comment 5 William Hubbs gentoo-dev 2019-03-31 18:33:38 UTC
Created attachment 571410 [details, diff]
0001-meson.eclass-fix-tests.patch

Here is the latest iteration of this fix.
Comment 6 William Hubbs gentoo-dev 2019-03-31 18:43:18 UTC
I fixed the lower case references to ninjaopts and makeopts. They are
all upper case.
Comment 7 Arfrever Frehtes Taifersar Arahesis 2019-04-08 17:53:59 UTC
(In reply to William Hubbs from comment #5)
> Created attachment 571410 [details, diff] [details, diff]
> 0001-meson.eclass-fix-tests.patch
> 
> Here is the latest iteration of this fix.

There is an unnecessary tab in the middle of this line:
+	[[ -n ${ninjaopts} ]] || 	[[ -n ${makeopts} ]] &&
                                 ^^^^^^^


(In reply to William Hubbs from comment #6)
> I fixed the lower case references to ninjaopts and makeopts. They are
> all upper case.

You can also merge two [[ ]] into one:
+	[[ -n ${NINJAOPTS} || -n ${MAKEOPTS} ]] &&
Comment 8 William Hubbs gentoo-dev 2019-05-27 19:38:21 UTC
Created attachment 577920 [details]
0001-meson.eclass-fix-tests.patch

Here is the latest iteration of this fix.
Comment 9 Larry the Git Cow gentoo-dev 2019-06-02 16:47:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe02c66d4b7638575778dcb7cbeb09c42a83c764

commit fe02c66d4b7638575778dcb7cbeb09c42a83c764
Author:     William Hubbs <williamh@gentoo.org>
AuthorDate: 2019-06-02 16:29:07 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2019-06-02 16:47:11 +0000

    meson.eclass: fix tests
    
    - use "meson test" to run tests instead of "eninja test"
    - calculate --num-processes based on ninjaopts or makeopts in the "meson test"
      call.
    - allow meson_src_test to accept arguments with the emesontestargs array
      or passed in the call like meson_src_configure
    
    Closes: https://bugs.gentoo.org/680010
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 eclass/meson.eclass | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)