-
Notifications
You must be signed in to change notification settings - Fork 7k
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
twister: Add support for Cpputest #74372
base: main
Are you sure you want to change the base?
Conversation
f471155
to
1284fbd
Compare
@vChavezB please take a look at the failed checks |
Thanks for the feedback, I must have missed it. |
1284fbd
to
bd0a57f
Compare
d526801
to
0ddcc40
Compare
would be possible to a test application for this? |
doc/develop/test/twister.rst
Outdated
not wish to update them to zTest. If using ``cpputest`` be sure to pass the | ||
verbose argument ``-v`` to `CommandLineTestRunner::RunAllTests`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the need for "-v"? I don't see it in the code. Also, it shouldn't be the case. Level of output verbosity mustn't affect a test result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verbose argument must be applied to your CPPUtest application. Correct me if I am wrong but if you do not add the verbose option, you do not get information about which test cases have passed. Instead you will only get a dot for each test that has passed (e.g. ....
) and at the end something such as OK (2 tests, 2 ran, 94 checks, 0 ignored, 0 filtered out, 2 ms)
.
Without verbose
..
OK (2 tests, 2 ran, 94 checks, 0 ignored, 0 filtered out, 2 ms)
With verbose
TEST(MyGroup, test1)
TEST(MyGroup, test2)
OK (2 tests, 2 ran, 94 checks, 0 ignored, 0 filtered out, 2 ms)
I made a sample here https://github.com/vChavezB/zephyr_cpputest_sample
|
I would support you to move this test into tests/cpputest |
4c4456c
to
c5fa9af
Compare
acee9e3
to
13d0b8c
Compare
These are the test cases that are identified by twister:
The one marked as The only test case that I defined in the sample code is ( TEST(my_test_group, test_1) {
} However, it seems that twister uses the name tests:
base.my_test_group:
platform_allow:
- native_sim/native/64
harness: "cpputest" This is implemented here:
|
13d0b8c
to
11b17f0
Compare
I have opened an issue (#81176) with the error that you mentioned. This is related to how test cases are parsed for other frameworks that are not ztest. |
772ca25
to
f734679
Compare
I have made a temporal solution to allow that my CPPUTest harness class deletes the fake testcase at start, but I would prefer that issue #81176 is solved. |
f734679
to
f399e87
Compare
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
f399e87
to
5736aed
Compare
303e4e1
to
d4ecb01
Compare
Similar to gTest, CppuTest is a CPP framework for unit tests. This commit adds support based on the console output of a cpputest test suite application. Signed-off-by: Victor Chavez <vchavezb@protonmail.com>
d4ecb01
to
647d718
Compare
Similar to gTest, CppuTest is a CPP framework for unit tests. This commit adds support to detect Cpputest console output when verbose mode is enabled (-v).
I am open for any feedback. My main use case was some unit tests that were written with Cpputest that I needed to port to Zephyr and integrate with twister.