Using RTEMS chains API in non-RTEMS unit testing?

Joel Sherrill joel at rtems.org
Fri Jan 4 19:28:14 UTC 2019


On Fri, Jan 4, 2019 at 12:54 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 03/01/2019 16:39, Martin Erik Werner wrote:
> > Hello,
> >
> > I'm currently using Google Test in order to run some unit tests on an
> > RTEMS application in a non-RTEMS Linux Development environment, via a
> > (fairly messy but operational) fake environment and mocking/faking
> > calls to RTEMS manager functionality (e.g. semaphores, message queues,
> > which are either uninteresting in the test scope, or used for
> > stimuli/checked-output).
> >
> > I'm interested in using the RTEMS chain API, but given the current unit
> > test setup, it looks like it would then need to mock/check each
> > individual chain call and emulate its behaviour, rather than being able
> > to check only a certain result in the final chain. It would be nice to
> > avoid needing to partially re-implement the chain API behaviour in each
> > test case (or re-implement it completely in a full fake).
> >
> > I've briefly looked at trying to separate the chain API functionality
> > in order to be able to link to it from the non-RTEMS unit test
> > application. But it appears like it is hard to avoid getting RTEMS
> > specifics pulled along with it.
> >
> > Does anyone have previous experience with compiling parts of RTEMS like
> > this? Or any tips on potential solutions?
> >
>
> It should be quite easy to satisfy the dependencies of the chain API. It
> is just RTEMS_INLINE_ROUTINE and a couple of data types.
>

I've copied the code out in the past and used it. There wasn't much to
address
and still shouldn't be. As Sebastian notes, the code is portable with a few
RTEMS-isms like that.

--joel

>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-brains.de
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20190104/207adb2b/attachment-0002.html>


More information about the users mailing list