Run unit-test during development
patrick at stwcx.xyz
Tue Dec 14 03:00:49 AEDT 2021
On Mon, Dec 13, 2021 at 04:46:13PM +0800, Deng Tyler wrote:
> Hi All:
> Is there any easier way to run unit-test during development instead of
> running run-unit-test-docker.sh?
If the repository is built using autotools or CMake there probably aren't a lot
of other options. Yocto has something called 'ptest' which would, in theory,
allow the package to build test-cases and deploy them onto the hardware to run
the unit tests. We don't have many repositories configured to support ptest
Any repository that is building using Meson should be able to run the unit tests
on a typical Linux development box. Some of them have not fully implemented
this though. What you want to look for is if the repository has a 'meson.build'
and 'subprojects' subdirectory that contains a number of 'foo.wrap' files. If
it has this, you can probably build the repository outside of
`run-unit-test-docker.sh` or a Yocto OE-SDK environment.
In that case, simply `meson builddir && ninja -C builddir test`.
If you come across a repository that supports Meson (meson.build file) but
doesn't have correct wrap files, those can be added fairly easily. I suspect
you could use these repositories as a reference:
$ ls */subprojects/phosphor-logging.wrap
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the openbmc