[orocosusers] gtest for components

Dears,

Has anyone opinions on which should or could be the best way to setup
unit tests to check the functionalities of components ?

example: run an operation, run an update with some data in some ports...

Cheers, Gianni.

[orocosusers] gtest for components

On the Rock side, we have unit tests using the ruby layer. It's currently
not super efficient (because it's asynchronous). That's something that will
be fixed.

Otherwise, setting up a GTest harness shouldn't be that hard. You would get
the synchronicity for free.

We're not using operations. The few test actions and assertions we have are:
- write on properties
- write on ports
- lifecycle transitions (check successful/failed)
- assert that a port gets a new sample. Verify properties on said sample
- verify that a task transitions to a given state (usually Exception)

The coordination layer (Syskit) has its own test harness.

Sylvain

2017-09-29 11:09 GMT-03:00 Gianni Borghesan <gianni [dot] borghesan [..] ...>:
> Dears,
>
> Has anyone opinions on which should or could be the best way to setup unit
> tests to check the functionalities of components ?
>
> example: run an operation, run an update with some data in some ports...
>
>
> Cheers, Gianni.
>
> --
> ------------------------------------------------
> Gianni Borghesan, PhD
> Robot Assisted Surgery group
> Robotics Research group
> KU Leuven,
> Department of Mechanical Engineering,
> Division of PMA
> Room 02.019
> Celestijnenlaan 300B, B-3001 Heverlee, Belgium.
> Tel: +32 163 29267
>
> ------------------------------------------------

[orocosusers] gtest for components

> On Sep 29, 2017, at 10:09, Gianni Borghesan <gianni [dot] borghesan [..] ...> wrote:
>
> Dears,
>
> Has anyone opinions on which should or could be the best way to setup unit tests to check the functionalities of components ?
>
> example: run an operation, run an update with some data in some ports...
>
>
> Cheers, Gianni.

I think that it depends on what you want to get out of the test. We unit test virtually all of our components. For computation components we will modify inputs and verify outputs. For coordination (i.e. state machine) components we will run the state machine through its various states. Communication components are a bit harder to test, so we frequently do those interactively with external utilities to simulate inputs and verify outputs.

We use cxxtest for all our tests (for legacy reasons), but any of the common test frameworks will be fine (e.g. gtest, boost test, cppunit).

HTH
S

[orocosusers] gtest for components

Hi

Good question. I would also be very interested in the answer.
I did have a look at GitHub repositories but didn't find anything.

Cheers
Keivan

On 29 September 2017 at 16:09, Gianni Borghesan
<gianni [dot] borghesan [..] ...> wrote:
> Dears,
>
> Has anyone opinions on which should or could be the best way to setup unit
> tests to check the functionalities of components ?
>
> example: run an operation, run an update with some data in some ports...
>
>
> Cheers, Gianni.
>
> --
> ------------------------------------------------
> Gianni Borghesan, PhD
> Robot Assisted Surgery group
> Robotics Research group
> KU Leuven,
> Department of Mechanical Engineering,
> Division of PMA
> Room 02.019
> Celestijnenlaan 300B, B-3001 Heverlee, Belgium.
> Tel: +32 163 29267
>
> ------------------------------------------------