eranpeer / FakeIt

C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
MIT License
1.22k stars 169 forks source link

Add single header support for Parasoft unit test tool. #203

Closed wbschiller closed 2 years ago

wbschiller commented 4 years ago

Add a single header to support Parasoft unit test tool. This implementation specifically supports Parasoft building IAR Arm projects and executing tests on the IAR CSpy Arm Simulator.

Parasoft is a unit testing tool that supports testing C/C++ applications. Parasoft is well suited for embedded and safety-critical applications. Since Parasoft is aimed at supporting light-weight C applications, it provides a stubbing framework to eliminate dependencies with low-level library calls in C. Stubbing is a critical component for testing embedded applications but Mocking is a preferred approach for dependency injection when testing C++ code. This is the motivation for adding FakeIt support to Parasoft. FakeIt was selected over open source projects (GoogleMock, Boost/Turtle) because it has no dependency on other test frameworks.

Note: this implementation does not support exceptions. The samples/fakeit_with_parasoft directory has a TestSuite that documents the FakeIt features that have been validated with the Parasoft / IAR configuration.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 99.923% when pulling 0493752a2a80c4337ca3fb7ad923e346a660d2ba on wbschiller:feature/parasoft-iar-support into 814f28cd509ef2a8cdf7fe370bd9ec6d3b181dc7 on eranpeer:master.

FranckRJ commented 2 years ago

To add support for a new testing framework you should add the integration code into the "config" folder, like other integrations.

wbschiller commented 2 years ago

@FranckRJ - if there is still interest in closing the PR, I can update the code and move the file per your comment. But it looks like there isn't interest. Let me know and I'll update.

FranckRJ commented 2 years ago

If you put the integration code in the config folder I'll merge the PR. Since it doesn't interfere with the rest of the library I don't really mind adding any test framework integration.

wbschiller commented 2 years ago

I'm not familiar with how I'd want to structure the code in the config folder to work properly with the Parasoft/IAR configuration. I was using the fakeit.hpp file directly in the test files. I've since moved on to another company and no longer have access to the Parasoft / IAR tools. I'll just close the PR.