Close

Testing C/C++ code with TPT

You can test C/C++ code via the TPT-internal virtual machine or by using the TPT-internal co-simulation platform FUSION.
The test environment that is needed to connect the C-code with TPT can be generated automatically by TPT.

 

You can use multidimensional arrays, maps, curves, and structured data types in your test settings.
Function calls and function stubs are also supported by TPT.


You can even debug your C-code during testing.
Tools like GCC, Visual Studio, BCC, or LLVM can be used to compile the executable.

Testing C and C++ via TPT's C-Code Platform

Using the EXE platform, you can test C and C++ code. You only need to connect the input and output signals of the system under test (SUT), the parameters, and the functions with the variables you have specified in TPT. After that, you create the test frame / test driver with your preferred compiler (for example GCC, Visual Compiler). You can always manually adapt the test frame as well as the test driver. Code coverage can be measured and shown with tools like CTC++ or Gcov. You can also use the C platform to test your C-code.

 

This has the advantage that you can manage your C-code files and functions, and trigger the code instrumentation and the compilation of the test frame directly in TPT. This platform also allows you to generate automatically test data with “TASMO for C” by PikeTec.

C/C++ code testing with TPT

C-code testing in the FUSION co-simulation test environment

The FUSION co-simulation environment by PikeTec allows interactions of an arbitrary number of software modules that practically need different execution environments. The software modules are tested as a single closed system. Software modules can be C-code, hardware adapters, and so forth.