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

1 view (last 30 days)
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?

Answers (1)

Altaïr
Altaïr on 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!

Categories

Find more on Results, Reporting, and Test File Management in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!