Can i perform SIL test using the simulink test tool for hand written code instead of auto generated one?

2 vues (au cours des 30 derniers jours)
I was ale to perform the SIL for matlab auto generated code. In the same way will i be able to do it for Hand written code?

Réponses (1)

Altaïr
Altaïr le 24 Mar 2025
According to the documentation, it's possible to perform SIL testing on handwritten code. More information can be found here: https://www.mathworks.com/help/releases/R2022a/sltest/generated-code-tests.html
Custom C or C++ code can be tested by importing it into Simulink using the Code Importer wizard in the Test Manager or via API commands at the MATLAB command line. This allows for unit testing of a subset of the C code or integration testing of the complete C or C++ code. Upon importing the code, the code importer:
  • Converts the C code functions to Simulink C Caller blocks and saves them in a Simulink library
  • Creates an internal harness for each Simulink C Caller block
  • Generates a test file
For unit tests, the code importer also creates a sandbox to isolate the imported functions. For examples on how to import custom C code into Simulink for unit testing, the following pages might be helpful:
These resources should provide more clarity on the process!

Catégories

En savoir plus sur Results, Reporting, and Test File Management dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by