-
Notifications
You must be signed in to change notification settings - Fork 8.3k
twister: Add support for Cpputest #74372
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
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
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 |
d4ecb01 to
647d718
Compare
|
Rebased and fixed according to #81176 (comment) |
647d718 to
6dad12c
Compare
| include(FetchContent) | ||
| FetchContent_Declare( | ||
| CppUTest | ||
| GIT_REPOSITORY https://github.com/cpputest/cpputest.git |
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.
is it possible to move cpputest project into zephyr umbrella? further, ztest has many configs which would be good to aligned with cpputest as well.
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.
By moving, do you mean declaring a west manifest under tests/cpputest/base/west.yml with cpputest or something such as creating a repository under the github url zephyproject-rtos/cpputest ?
about the configs you mean creating an interoperability layer to make the KConfigs from ZTest compatible when using cpputest such as
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.
By moving, do you mean declaring a west manifest under
tests/cpputest/base/west.ymlwithcpputestor something such as creating a repository under the github urlzephyproject-rtos/cpputest?
yes
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.
about the configs you mean creating an interoperability layer to make the KConfigs from ZTest compatible when using cpputest such as
check this file,
https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/testsuite/ztest/Kconfig
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.
By moving, do you mean declaring a west manifest under
tests/cpputest/base/west.ymlwithcpputestor something such as creating a repository under the github urlzephyproject-rtos/cpputest?yes
Do you mean yes...declaring a west manifest or yes creating a repository? If you mean declaring a west manifest, do you mean adding cpputest to the root of the zephyr project repo, such as is the case for bsim, see
Line 36 in 961593d
| - name: babblesim_base |
check this file,
https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/testsuite/ztest/Kconfig
Are you proposing to add a repository under /subsys/testsuite/cpputest and replicate the Kconfigs from ztest for cpputest?
sorry for the specific questions but its not that clear for me as I havent used ztest.
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.
no actually. I will raise this problem in testing working group this week. Maybe we can enhance in following PR, but would this possible that you create a similar Kconfig for cpputest first.
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.
per TWG meeting, we agreed that Kconfig is no need to aligned with ztest.
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.
thanks for the info. So what would be required to continue with the PR.
Kind regards
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.
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.
Is it enough to tag him here? @nashif , as per @hakehuang , there is a question regarding adding cpputest to the zephyr project.
From my perspective unless, someone will mantain cpputest for the zephyr project it is a good idea to add it. If not I would suggest just adding a west manifest to tests/cpputest/base/west.yml if using the CMake FetchContent_Declare is not preferred by the maintainers.
|
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. |
6dad12c to
ea29907
Compare
|
rebased as there was a conflict in the docs with the addition of harness "power". Will leave this PR for any further discussion on what to do with cpputest as mentioned here #74372 (comment) |
16fe82e to
5b75d67
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 <[email protected]>
5b75d67 to
925cd69
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. |
|
Are there still plans to merge this? |



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.