-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Some tests fail when building with -UTEST
#194
Comments
I am a little lost about how to produce these diagnostics.
This run cake in all files in "test mode". 10 tests are failing (under development) There is also -DTEST that compile cake in test mode runs 63 test functions. Most of it is preprocessor test.
|
What is missing is running |
What -test-mode does is to pass test if we have 0 warnings 0 erros. Sample: #pragma safety enable
struct X {
int i;
};
void f(struct X* _Opt p)
{
int i = p ? p->i : 0; //no warning
int i3 = p->i;
#pragma cake diagnostic check "-Wanalyzer-null-dereference"
int i2 = p ? 0 : p->i; //warning
#pragma cake diagnostic check "-Wanalyzer-null-dereference"
} pragma is used to dismiss the error/warning and check we have that error/warning.
|
I misunderstood the So running a bare "cake-unittest" succeeds, but "cake" fails to parse certain sources (including SDL). |
Did you add test files on CI?
The directory
has a lot of source but not prepared to run in test mode. |
I do a glob in https://github.com/madebr/cake/actions/runs/9945512803 ctest expects the return code to be non-zero for a failing test. |
I changed the meaning of -DTEST. |
CI is not working with cake compiled with x64. But in my machine , with sanitizer etc..it works normally. |
something you must be aware is that cakeconfig.h is always the cakeconfig.h that is at same path of executable.
|
I thought the return code was fixed. At main() if (report.test_mode)
{
return report.test_failed ? EXIT_FAILURE : EXIT_SUCCESS;
}
return report.error_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS;
} I also found some weird behavior with pointer to "report". Maybe I need to refactory that. Windows x64 is failing but not on my machine. This is also weird. About the includes, we list on GCC. But maybe we need to add some flag to x64 before? Maybe this command line needs to be changed x86 x64 char* command = "echo | gcc -v -E - 2>&1"; |
by the way "en-cpp-reference-c" directory is not prepared for test-mode.. Also some samples are linux only. |
I know some distros have separate include directories for different architectures (i686 vs x86_64).
Good to know. I think not-yet-implemented functionality should move to a |
For some reason, running cake on the cake sources times out. |
I ported the 32-bit: /*
* This file was generated reading the ouput of
*
* echo | /usr/bin/gcc -m32 -v -E - 2>&1
*
*/
#pragma dir "/usr/lib/gcc/x86_64-linux-gnu/11/include"
#pragma dir "/usr/local/include"
#pragma dir "/usr/include" 64-bit: /*
* This file was generated reading the ouput of
*
* echo | /usr/bin/gcc -m64 -v -E - 2>&1
*
*/
#pragma dir "/usr/lib/gcc/x86_64-linux-gnu/11/include"
#pragma dir "/usr/local/include"
#pragma dir "/usr/include/x86_64-linux-gnu"
#pragma dir "/usr/include" |
All tests in /tests/unit-test and /tests/en-cpp-reference-c/ are passing. Preprocessor errors where not reported to the pass test.. now they are. |
(I added CMake project generation to
build.c
. Let me know if you are interested. ci)The text was updated successfully, but these errors were encountered: