Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Deferred initialization of Runtime Library

Options
Andrey Madan
Andrey Madan Posts: 388 ✭✭✭
edited July 2021 in C/C++test

In some cases where runtime library during initialization needs to have some software/hardware components to be up and running and initialized prior to initialization. e.g.: RTOS.
By default: When collecting application level coverage, runtime library is being initialized as early as fist instrumented line of code is being executed. In order to NOT automatically initialize runtime you need to do the following:

1) Need to build runtime differently.

Add the CPPTEST_AUTO_INITIALIZATION=0 to the list of your macros during building runtime library:

$ make EXTRA_CFLAGS="-DCPPTEST_AUTO_INITIALIZATION=0"

2) need to add this trigger in code (e.g. right after OS_Init) to initialize parasoft runtime:

#include "cpptest.h"
CppTest_InitializeRuntime()