Main Content

coder.profile.test.TestHook

Define custom callback functions for coder.profile.test.runTests

Since R2025a

Description

Use a coder.profile.test.TestHook object to define custom callback functions or hooks for the coder.profile.test.runTests function. When you use coder.profile.test.runTests to run software-in-the-loop (SIL) or processor-in-the-loop (PIL) tests of a model, the function invokes the hooks at different execution points.

Creation

Create a subclass of coder.profile.test.TestHook that defines functionality for hooks TestSetup, TestStart, TestEnd, and TestCleanup. The coder.profile.test.runTests function uses your coder.profile.test.TestHook object to invoke:

  • TestSetup at the start of the function, before running any SIL or PIL tests.

  • TestStart just before running each SIL or PIL test.

  • TestEnd just after running each SIL or PIL test.

  • TestCleanup just before the end of the function, after running all SIL or PIL tests.

Examples

Implement Test Hooks for coder.profile.test.runTests

For an example that shows you how to implement test hooks for the coder.profile.test.runTests function, see Customize Automated Code Profiling Using Hooks.

Version History

Introduced in R2025a