Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Tests #29

Open
gbalke opened this issue Jul 24, 2020 · 2 comments
Open

Unit Tests #29

gbalke opened this issue Jul 24, 2020 · 2 comments
Assignees

Comments

@gbalke
Copy link
Member

gbalke commented Jul 24, 2020

To get started with unit testing sections of the code-base, I thought we should first pick a reasonable framework. Looking at the list on wikipedia, I found https://github.com/Snaipe/Criterion to check the most boxes and it looks pretty nice from a first glance! Thoughts? @brentyi @wuphilipp @luca-della-vedova

@brentyi
Copy link
Collaborator

brentyi commented Jul 24, 2020

Is the plan to cross-compile parts of the firmware and run tests locally?

I don't know much about the options for test frameworks but have been using gtest and it's pretty neat. Would also be the only choice for the higher level software if we want to use rostest.

Criterion looks cool too. (aside: considering what it is, found it mildly humorous that so many of its own builds are broken)

@gbalke
Copy link
Member Author

gbalke commented Jul 24, 2020

Yup, I want to cross-compile for local tests. There's a significant chunk of the code-base this will work for straight away and, if we want to test drivers, we can mock data at register addresses to simulate hardware behavior. I believe that getting better coverage via tests will also lead to finding existing bugs.

Also regarding Criterion, they seem to be failing tests on mac and windows which is unsurprising given the inability for the developer to strictly control the test environment.

gtest looks pretty sweet. If you have experience setting it up, it would probably help with overhead. I have no preference for which testing system we use only that it does the work and with minimal time wasted (good documentation, streamlined install process, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants