Run unit-test during development

Deng Tyler tyler.sabdon at gmail.com
Thu Dec 16 16:53:41 AEDT 2021


Hi Patrick:
    Thank for your kind reply and that's really helpful. I am trying to
figure out the meson subprojects system but still encounter lot of barrier.
I run unt test using command "meson buiildir && ninja -C builddir test" in
my development environment but never work. Could you help to cite an
example in current openbmc repository? Do openbmc contributor run unit test
by meson subprojects or run-unit-test-docker.sh when they are developing?

Tyler

Patrick Williams <patrick at stwcx.xyz> 於 2021年12月14日 週二 上午12:00寫道:

> 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
> though.
>
> 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
> dbus-sensors/subprojects/phosphor-logging.wrap
> google-misc/subprojects/phosphor-logging.wrap
> openpower-debug-collector/subprojects/phosphor-logging.wrap
> openpower-occ-control/subprojects/phosphor-logging.wrap
> openpower-vpd-parser/subprojects/phosphor-logging.wrap
> phosphor-bmc-code-mgmt/subprojects/phosphor-logging.wrap
> phosphor-certificate-manager/subprojects/phosphor-logging.wrap
> phosphor-debug-collector/subprojects/phosphor-logging.wrap
> phosphor-health-monitor/subprojects/phosphor-logging.wrap
> phosphor-led-manager/subprojects/phosphor-logging.wrap
> phosphor-networkd/subprojects/phosphor-logging.wrap
> phosphor-objmgr/subprojects/phosphor-logging.wrap
> phosphor-sel-logger/subprojects/phosphor-logging.wrap
> phosphor-virtual-sensor/subprojects/phosphor-logging.wrap
> phosphor-watchdog/subprojects/phosphor-logging.wrap
> service-config-manager/subprojects/phosphor-logging.wrap
> telemetry/subprojects/phosphor-logging.wrap
> ```
>
> --
> Patrick Williams
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20211216/77a8a6ad/attachment.htm>


More information about the openbmc mailing list