-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
doctest in embedded #355
Comments
Well one option is to define your own reporter (just leave all the methods completely empty) and use it with the Is this good enough? |
Hi
When you testing on embedded, it is last stage of testing procedure (after testing on PC where footprint does not matter), and only what is interesting is: if assert fails and in which line and file. That is in general all what you need (well, mostly). |
Everthing is visible to your compiler and it should optimize the unused symbols away. Unfortunately, it cannot detect, that you will never use the two built-in reporters, because the compiler does not know your comandline arguments. I'd suggest some On my embedded platform (Cortex-M3 with IAR EWARM), just Or you could implement the macros that you use to almost nothing, except |
Why is there a big footprint? Is memory use an issue? Or is processing time because of all the printing to stdout? Or both? |
The "large footprint" @GregKon means, is probably the code memory -- I guess. It is a common issue when using C++ with the STL, because all (used) template specializations produce slightly different assembly with little to no re-use. Of course this is good for performance on a PC, where binaries are on large hard drives, but it means that any embedded µC's ROM gets filled pretty fast. |
@UnePierre the printing can be removed by using a stub reporter as I mentioned before (which will make the runtime faster because of no printing to stdout). However, there will still be virtual calls to the reporter on each assert, and also that won't have any effect on the compiled code - all template specializations will be the same and still present in the binary. I don't think doctest will be able to provide anything lighter than that... |
Hi I do also use IAR for ARM. some benchmark: Cortex M0, IAR 8.50 Optimalziation highest - size indeed assertion may be changed. but this is not big issue I can live with it, there is still some space for test. |
Then maybe go for replacing the |
Yet another solution, that needs no modification to doctest: |
For IAR this might be handy as well: #369 (comment) |
|
this is easy an no problem at all. |
does it decrease footprint? |
No. It might even increase -- so use it with your simulator. |
I'm closing this as it seems there's nothing more to contribute to this issue - feel free to comment if that's not the case. |
Dear
We are testing doctest in embedded environment, some small success so far,
However, it is quite big footprint for small devices, we use dual targeting first PC host when footprint do not matter at all and verbose information is useful, than test on target where footprint matter but verbose information do not.
So on embedded target what I am interesting in is only PASS or FAIL for all test.
Is there option to disable serializing or formatting output option (xml) what probably increase footprint ?
/Greg
The text was updated successfully, but these errors were encountered: