GNOME Bugzilla – Bug 776718
meson: prefix tests with component name
Last modified: 2017-01-30 20:00:19 UTC
'mesontest -C build --list' can be used to list all the available tests in subprojects. We can then use 'mesontest -C build/ $NAME' to run a specific test. At the moment tests aren't namespaced by (sub)project, making it less clear which component they're testing and risking name clashes. I'd suggest to prefix them with their component to fix this. So for example "gst/gstbuffer" would become "gstreamer/gst/gstbuffer".
Created attachment 342724 [details] [review] meson: prefix tests' names with 'gstreamer' Make it clear they are testing the 'gstreamer' (core) component.
If you're ok with this idea I'll update the other components as well.
I feel this shouldn't be needed and meson should handle any clashes by using subproject names automatically already. (Doesn't it already?)
I agree with Tim, it makes more sense to namespace this on the Meson end, not in our build files. That will also ensure that there aren't test name collisions in the future.
So I tested the current behaviour, and if you run 'mesontest generic/states', it will run all the 'generic/states' tests: $ mesontest generic/states -C build ninja: Entering directory '$PWD/build' ninja: no work to do. Running: generic/states 1/1 Running: generic/states 1/1 Running: generic/states 1/1 $ But there's no way to run one of them in particular, and it's not so easy to figure out which one failed if one of them failed without proper debugging messages. Should definitely do some namespacing upstream since that's the only fool-proof way to do it.
Then we should just namespace those generic tests that are duplicated everywhere imho ;)
Ok, I reported this issue to meson: https://github.com/mesonbuild/meson/issues/1273 Let's close this for now, I'll reopen if meson upstream disagrees that's something which should be fixed in mesontest itself.
It's now fixed with latest mesontest: https://github.com/mesonbuild/meson/pull/1279 I'll update to gst-build's README to make it clear how to use it.
Created attachment 344506 [details] [review] README: update tests section - Add example to list all tests - Add example to run all tests of a specific component - Update example running one specific test to avoid test name clashes with other components.
Comment on attachment 344506 [details] [review] README: update tests section Thanks: commit 5a06cf2807bcf94587ff49ad91932971bb6550d7 Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> Date: Mon Jan 30 09:08:59 2017 +0100 README: update tests section - Add example to list all tests - Add example to run all tests of a specific component - Update example running one specific test to avoid test name clashes with other components. https://bugzilla.gnome.org/show_bug.cgi?id=776718