C and C++ code can be easily tested with TPT. Testing C or C++ code is possible for module and integration tests. Every piece of C/C++ code — small, big, or even integrated SW builds — can be tested with TPT. TPT masters your software tests and greatly simplifies creation, management, maintenance and analysis of tests. Software-in-Loop Testing with TPT can be easily automated and it integrates seamlessly into your test environment.
By default, TPT supports lots of common C or C++ code features and even less frequently used ones. For special requests TPT is also flexible to adapt to manual tweaks. TPT masters your C and C++ tests — and you save time to focus on your product development. SiL Testing with TPT is efficient testing.
TPT analyzes the structure of your C or C++ code automatically. It extracts all data types, variables and functions to get all the interface information of the system under test. TPT handles scalar variables, arrays, multidimensional arrays, structs, pointers, maps, curves and class instances. Even fix point scaling is easily managed by TPT so that the tester operates with natural physical values.
Function calls and function stubs are also supported and generated by TPT allowing the user to control their return values and arguments. The task scheduling with one or many C functions makes testing of your code very easy and flexible.
Stub missing functions of your C code in TPT. You can easily analyze the sources used in your code and define any unresolved references. In this tutorial you can see how easy this can be done.
TPT automatically generates wrapper code that encapsules your code and connects it to TPT. If needed, TPT instruments your code either to access non-public variables or to track coverage conditions.
Tools such as MinGW, GCC or Visual Studio can be used to compile the executable.
You don’t have to care about all the details of test harness generation and test execution. It is as simple as pushing a button. TPT together with the generated test harness do all the work for you. TPT starts and controls the entire test execution.
You can even debug your C or C++ code during testing.
Complex C or C++ tests or test suites can be executed unattended in batch mode or by using the TPT Jenkins plugin, for example overnight. TPT can also remote control several execution instances in parallel which can significantly reduce test execution time.
After the test execution, TPT starts the test assessment based on the collected data for C or C++ variables and parameters. Also non-exported variables can be tracked by TPT and included in those assessments. Finally, a report of the results is generated.
In case your code is very special and needs your own setup to run TPT has the option to build your own flexible environment yourself. Software-in-Loop testing with TPT is highly adaptable.
You just need to compile and link an executable program with the TPT VM (TPT’s virtual machine library) connected to your SUT. The API of the TPT VM comes with convenient functions for initialization, variable bindings and cyclic interactions between the TPT VM and your SUT code for the whole test that usually runs over a certain time.
With this API you can build your own test setup while using the strength of TPT test modeling, test execution, test assessment, test reporting, and test process support.
The FUSION co-simulation environment of TPT allows interaction of one or more “simulation modules” — called FUSION nodes. Off-the-shelf, many FUSION nodes exist that allow interaction with 3rd party software and hardware components. For special needs, the public API of FUSION can by used by customers to connect additional FUSION nodes.
As an example, you can test C or C++ code (compiled as a FUSION node) together with plant models implemented in Simulink or with interfaces to other 3rd party software or hardware (e.g. CAN connectors).
Another great feature of TPT is the ability to test C or C++ code using an Eclipse CDT and GDB (GNU debugger) connector. Using TPT with Eclipse CDT and GDB allows to compile, test and debug C or C++ code. Remote control of the GNU Debugger makes debugging even easier and allows access to almost any variable in the code at runtime. The Eclipse CDT/GDB simulation can be controlled, observed and debugged directly and automatically via breakpoints and register accesses at runtime.
If you want to learn more about SiL Testing, we have summarized the key aspects for you here. Find out about the central strengths of Software-in-Loop testing and its role as part of a model-based development approach
By clicking 'I Accept' you agree to the storing of first- and third-party cookies on your device to enhance site navigation, analyze site usage, and assist in Synopsys marketing efforts. For additional information, please see the Synopsys privacy policy. If you are under 16 and wish to give consent to optional services, you must ask your legal guardians for permission. You can revoke or adjust your selection at any time under Settings.
If you are under 16 and wish to give consent to optional services, you must ask your legal guardians for permission. Here you will find an overview of all cookies used. You can give your consent to whole categories or display further information and select certain cookies.