Harnais de test
Créez un environnement de simulation propre au test pour votre modèle au moyen d’un harnais de test. Vous pouvez isoler des blocs individuels pour les tests unitaires et ajouter des entrées, une logique de vérification et des blocs de tableau de bord. Procédez à des tests en boucle fermée en ajoutant des modèles de systèmes physiques au harnais de test. Testez les modifications potentielles du design dans le harnais de test avant de modifier le modèle de production.
Par rapport aux modèles séparés pour les tests unitaires, les harnais de test proposent des fonctionnalités de gestion et de synchronisation dans le canevas de modèle. Si votre modèle fait l’objet d’une gestion des modifications, vous pouvez enregistrer les harnais de test dans des fichiers externes, sans modifier le modèle principal.
Vous pouvez tester le code généré en simulant des harnais de test en mode SIL ou PIL. Vous pouvez également tester le code manuel externe en créant des harnais de test pour les blocs C Caller ou S-Function.
Outils
| Simulink Test Manager | Testing models and code in different execution environments, manage test suites, and analyze and report results |
Rubriques
- Test Harness and Model Relationship
Test a Simulink® model in an isolated environment, using a separate workspace and configuration set accessed via the model canvas.
- Créer un harnais de test
Utiliser un harnais de test pour isoler le composant à tester
- Create or Import Test Harnesses and Select Properties
Create, import, and customize test harness configurations for your model and subsystem.
- Manage Test Harnesses
Manage test harnesses, including opening, converting, closing, deleting, and exporting.
- Synchronize Changes Between Test Harness and Model
Transfer configuration sets and workspace variables, update component design, and rebuild harness to reflect the latest design.
- Test Harness Construction for Specific Model Elements
Describes how test harnesses are constructed for certain Simulink semantics and component types.
- Test Library Blocks
Test reusable components using tests for libraries, library blocks, and linked blocks.
- Customize Test Harnesses
Create reusable functions and callbacks that customize test harnesses.
- Create Test Harnesses from Standalone Models
Import standalone models as test harnesses in Simulink Test™.
- Use Stateflow Chart for Test Harness Inputs and Scheduling
Use Stateflow Chart to define test harness inputs and test sequence.