This repository has been archived by the owner on Jul 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
calltrace.introduction
Klemens David Morgenstern edited this page Apr 4, 2018
·
1 revision
metal.calltrace
is a light-weight calltrace library that allows to validate call sequences.
- call tracing at runtime
- detailed output through the dbg-runner
- human-readable-format or json output
- C and C++ implementation
Here's a simple example of a test with metal.test.backend
:
#include <metal/calltrace.hpp>
void foo();
void bar();
void func() {foo(); bar();}
int main(int argc, char *argv[])
{
//Check that func calls foo and bar in this order.
metal::test::calltrace<2> ct{&func,
&foo, & bar};
func();
return ct ? 0 : 1;
}
Using the metal.runner
we can launch the test on a remote arm device, which would look like this:
metal.runner --debug --gdb=arm-none-eabi-gdb --exe=test.elf --lib metal-calltrace metal-exitcode --remote localhost:3333 --other "openocd -f ..\scripts\interface\stlink-v2.cfg -f ..\scripts\target\stm32f4x.cfg -c init"
Which will give us an exit-code unqual to zero if the call sequence doesn't match.
- 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