I am working on an embedded systems project using ACE Framework and all the development is done using eclipse IDE. I am looking for a good testing framework. Basically the project involves parsing of incoming data and I am searching for a unit testing framework which suits my project. What are my options here?
-
1Welcome to SO! When you place a question try to add a minimum content: input sample, expected output sample, what did you try, research and where are you stuck. So leave a question, show us your code, what did you try and your research: stackoverflow.com/help/how-to-ask You can also add a bounty to draw more attention to this question once you have enough reputation: stackoverflow.com/help/privileges/set-bountiesBorja– Borja2020-01-20 07:19:02 +00:00Commented Jan 20, 2020 at 7:19
Add a comment
|
3 Answers
4 Comments
Bktero
My team has Cath2 working on a STM32 discovery (Cortex M-4), so this is a possible choice indeed.
Yvan Pearson
Testing doctest for STM32 (m4)
CivFan
@Bktero I checked the feature list for Catch, and it doesn't mention mock support or embedded support. How does it work with STM32 in your experience -- compiling for Linux and running there, or compiling to run on the STM32 device?
Bktero
@CivFan that was a long time ago, I'm sure if I remember all this! Indeed, Catch2 doesn't have support for mock objects. It doesn't need anything special for "embedded support". From what I recall, you can do something like this:
#define CATCH_CONFIG_RUNNER Catch::Session session; session.configData().testsOrTags.emplace_back("[some tag]"); session.run(); The test results will be printed to stdout.Try ceedling: It is UT framework from throw the switch, from http://www.throwtheswitch.org/ceedling
3 Comments
Deepak Keynes
More general thing.
volpato
According to its website, ceedling doesn't support C++
PrasadGandhi
@volpato, yes, it supports C.
I recommend using this light-weight unit testing framework designed for embedded software use with C++ that I created: https://github.com/Novodes/SimpleTest-EmbeddedSafety/
It was tested with ARM Compiler version 6.6.4 and 6.6. There are just two files: simpletest.cpp and simpletest.h
This is based on the SimpleTest repository I forked and adapted for embedded software. It is super easy to use and integrate into your code.