-
Notifications
You must be signed in to change notification settings - Fork 4
unit.faq
No, this library itself works with all compilers, which follow the language standards (C89, C++11). But, the debugger-runner is currently only available for gdb. What that means is, that the in-depth analysis and output of the values tested are only available when the program can be run through the gdb. We do however have plans to extend that, the next addition would be the lldb.
Given a test like this
void test_case()
{
METAL_CRITICAL(METAL_ASSERT(false));
METAL_LOG("Should not be executed");
}
the second line will be executed if not in hosted mode. The reason is, that the execution control will be done
by the debugger. There is no implementation of that in the code; even though it would be possible (e.g. with exceptions) it would amount
to a lot of code, which is just not necessary with the debugger. In order to take that into account, you will have to cancel manually, possible with return
.
void test_case()
{
METAL_CRITICAL(METAL_ASSERT(false));
if (METAL_ERROR())
return;
METAL_LOG("Should not be executed");
}
This will then yield the similar behaviour in hosted as in standalone mode. Please keep in mind, that the standalone mode is not meant as the usual use-case, but as a solution for time-critical builds.
The test+library can be used without the debugger altogether, which means that the METAL_REPORT
will indicate the success. Additionally a form of hybrid is possible if
the test implementation is differnet. That is METAL_NO_IMPLEMENT_INCLUDE
must be defined and and a source file including metal/unit.ipp
must be added.
Then only the function which is used by the breakpoint will have debug symbols.
Yes, this is possible with gcov. GCov requires you to compile and link with the --coverage
flag set. Gcov will then attempt to use the syscalls to write files,
which of course will do nothing in a bare-metal environment. If you are using the newlib in your project, we provide code, so
those calls can be redirected through the runner.
Theoretically it is possible to call __gcov_flush
anywhere in the program so the whole data gets dumped. But to make that work,
you would also need to move the files with the generated test data. We will research this, and hopefully provide a solution,
which will then be provided as a seperate plugin.
- Overview
- Runner Introduction
- Runner Invocation
- Runner Plugins
- Runner Extender
- Runner FAQ
- Runner Reference
- Unit Introduction
- Unit Tutorial
- Unit FAQ
- Unit Reference
- Calltrace Introduction
- Calltrace Tutorial
- Calltrace FAQ
- Calltrace Plugin
- Calltrace Reference
- Serial Introduction
- Serial Tutorial
- Serial Invocation
- Serial Reference