Need ideas for how to add installable unit tests to GStreamer

Carlos Rafael Giani crg7475 at mailbox.org
Sun Oct 20 16:03:30 UTC 2019


Hello,

as part of my efforts to transition the Yocto/OE recipes from using 
autotools to using meson, I have to look at the unit test integration. 
Yocto has the "ptest" (package test) feature, which encapsulates test 
suites of packages. In GStreamer's case, this would encompass the tests 
in tests/check. Keep in mind that we are talking about cross compilation 
here.

With autotools builds, what the Yocto recipes do is to install make on 
the target, along with a Makefile. To run the test suite, "make check 
-k" is executed on the target.

Now, with meson, unit tests are run differently, through meson's unit 
test support itself. However, I'd rather not repeat what was done in the 
past and install meson on the target. Instead, I think it would be 
better to either add an environment variable to source from prior to 
executing unit test binaries, or a shell script for each unit test 
binary. Either way, this would set up the environment variables 
necessary for running tests prior to executing the actual binary.

Currently though there is no support for this in the meson.build files. 
Neither are unit tests installable at this moment. The latter issue was 
easily resolved by adding an "installed_tests" feature to 
meson_options.txt and adding these lines to the executable() call in 
tests/check/meson.build :

         install_dir: installed_tests_execdir,
         install: installed_tests_enabled,

and these lines to the root meson.build:

installed_tests_execdir = join_paths(libexecdir, 'installed-tests', 
'gstreamer-1.0')
installed_tests_enabled = get_option('installed_tests')

However, this installs only the binaries themselves, and does not add 
any environment setup. That's where I am currently stuck. I do not see 
how I could dump the "env" environment from tests/check/meson.build to a 
shell script.

Does anybody else have an idea how to address this?

Furthermore, several GNOME projects such as glib, gtk+, json-glib 
support this test runner: 
https://gitlab.gnome.org/GNOME/gnome-desktop-testing

This test runner also supports the Test Anything Protocol (TAP): 
https://en.wikipedia.org/wiki/Test_Anything_Protocol

Are there any plans for supporting TAP in GStreamer unit tests? And 
would it make sense for GStreamer to support gnome-desktop-testing?



More information about the gstreamer-devel mailing list