!testing/cmocka: Compile cmocka as a libary only by default#3270
!testing/cmocka: Compile cmocka as a libary only by default#3270xiaoxiang781216 merged 1 commit intoapache:masterfrom
Conversation
|
Build is failing because sim:citest needs the change in apache/nuttx#17653 |
a9e2457 to
ffea164
Compare
ffea164 to
8b390fe
Compare
|
Any ideas why the CI test is failing? It seems that the cmocka binary is present, just an assertion is failing. |
|
@linguini1 it is saying that boards/risc-v/qemu-rv/rv-virt/configs/citest/logs/ is not tracked, not sure if it needs to be. Maybe @simbit18 or @lupyuen has some idea, they know more about the citest |
|
Please excuse my silence, but I have some important family matters to resolve. Unfortunately, real life is not binary, 0 and 1, black and white, etc., |
cederom
left a comment
There was a problem hiding this comment.
Thank you @linguini1 very nice hack for reuse of cmocka! Looks like you like it? :-)
One remark - we are changing default behavior therefore we should mark this change as breaking correct? Thank you for providing backward compatible approach where cmocka application can be easily generated "the old way"! Can you please add ! first character mark to the PR title and git commit topics with a quick-fix instructions on how to update on user side after change? :-)
|
CI fails due to https://github.com/apache/nuttx-apps/actions/runs/20508476636/job/59001537281?pr=3270#step:10:1221
more detailed failure report in line 1144: EDIT2: |
Yes! Definitely less configuration options than Unity, but it's worth it for the extra flexibility in performing setup/teardown and running test groups.
Done! |
8b390fe to
ae3e4da
Compare
The cmocka test framework is compiled as a library by default in (apache/nuttx-apps#3270), and does not include the cmocka application binary unless CONFIG_TESTING_CMOCKA_PROG=y. This commit updates the defconfigs which include cmocka to also compile the cmocka binary, which is the behaviour they were created with. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
|
|
BREAKING CHANGE This commit introduces a Kconfig switch to include the cmocka binary built from cmocka_main.c. The default behaviour is now changed so that cmocka is built as a library only, which would be the desired behaviour for users creating their own cmocka projects. To restore the old behaviour (where the cmocka program is compiled), add CONFIG_TESTING_CMOCKA_PROG=y to your legacy configuration. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
ae3e4da to
eec934d
Compare
Fixed! Is there a PR open for that? I checked the contributing guidelines but I couldn't find that stated. |
cederom
left a comment
There was a problem hiding this comment.
Thank you @linguini1 :-)
|
So can this and the twin PR be merged? |
Unfortunately none PR with error could be merged, unless it is a transient error in our CI. Otherwise all new PRs will fail because the CI catch the same error again and again. I restarted the CI, so let see if the error get fixed, case the error persist I suggest you to update your upstream and rebase your branch to it, sometimes it is enough to fix the error ;-) |
Hmmm, then it'll be impossible to merge this since it needs the NuttX PR to get merged in order to pass CI, and the NuttX PR needs this to merge to pass CI as well. Any ideas how to get around that issue in the coupling? It's because this change directly affects the configuration the CI runner uses. |
|
Kinda corner case because we change testing stuff that affects ci and had cyclic dependency between two repos that also affects ci that in cycle is affected by the change :-P We may force push to the upstream, but this kind of breaking changes should be avoided, maybe there is another way to introduce / implement the change? Maybe additional change in the ci setup here in this pr on gh in pair with this cmocka change? If there is no other way we may need to force push on the one repo to enable the other. |
Ok, if the fail is just because circular dependence, then we can merge with error, assuming after both commits are integrated the error will be fixed |
That's correct. At least, things compile and run fine in my local testing. |
The cmocka test framework is compiled as a library by default in (apache/nuttx-apps#3270), and does not include the cmocka application binary unless CONFIG_TESTING_CMOCKA_PROG=y. This commit updates the defconfigs which include cmocka to also compile the cmocka binary, which is the behaviour they were created with. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
The cmocka test framework is compiled as a library by default in (apache/nuttx-apps#3270), and does not include the cmocka application binary unless CONFIG_TESTING_CMOCKA_PROG=y. This commit updates the defconfigs which include cmocka to also compile the cmocka binary, which is the behaviour they were created with. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Summary
BREAKING CHANGE
This commit introduces a Kconfig switch to include the cmocka binary built from cmocka_main.c. The default behaviour is now changed so that cmocka is built as a library only, which would be the desired behaviour for users creating their own cmocka projects.
To restore the old behaviour (where the cmocka program is compiled), add
CONFIG_TESTING_CMOCKA_PROG=yto your legacy configuration.Impact
Cmocka is now only built as a library, so the
cmockabinary is no longerincluded by default.
PR (apache/nuttx#17653) to the NuttX kernel preserves the compilation of the
cmockabinary for the two existing defconfigs which use the cmocka application.Testing
Compilation of the cmocka libary without the binary using
sim:nshas a basis:Then, when disabling
CONFIG_TESTING_CMOCKA_ASLIB, the compilation is:and I can run the cmocka application on sim: