0% found this document useful (0 votes)
59 views1 page

30_PDFsam_matlab_prog

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views1 page

30_PDFsam_matlab_prog

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Test Suite Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34-33
Test Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-33
Test Running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-34
Programmatic Access of Test Diagnostics . . . . . . . . . . . . . . . . . . . 34-34
Test Runner Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-35

Author Class-Based Unit Tests in MATLAB . . . . . . . . . . . . . . . . . . . 34-36


The Test Class Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-36
The Unit Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-36
Additional Features for Advanced Test Classes . . . . . . . . . . . . . . . 34-37

Write Simple Test Case Using Classes . . . . . . . . . . . . . . . . . . . . . . . 34-39

Write Setup and Teardown Code Using Classes . . . . . . . . . . . . . . . 34-42


Test Fixtures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-42
Test Case with Method-Level Setup Code . . . . . . . . . . . . . . . . . . . 34-42
Test Case with Class-Level Setup Code . . . . . . . . . . . . . . . . . . . . . 34-43

Table of Verifications, Assertions, and Other Qualifications . . . . . 34-45

Tag Unit Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-47


Tag Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-47
Select and Run Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-48

Write Tests Using Shared Fixtures . . . . . . . . . . . . . . . . . . . . . . . . . . 34-51

Create Basic Custom Fixture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-54

Create Advanced Custom Fixture . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-56

Use Parameters in Class-Based Tests . . . . . . . . . . . . . . . . . . . . . . . 34-61


How to Write Parameterized Tests . . . . . . . . . . . . . . . . . . . . . . . . 34-61
How to Initialize Parameterization Properties . . . . . . . . . . . . . . . . 34-62
Specify Parameterization Level . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-63
Specify How Parameters Are Combined . . . . . . . . . . . . . . . . . . . . 34-64
Use External Parameters in Tests . . . . . . . . . . . . . . . . . . . . . . . . . 34-64

Create Basic Parameterized Test . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-66

Create Advanced Parameterized Test . . . . . . . . . . . . . . . . . . . . . . . . 34-71

Use External Parameters in Parameterized Test . . . . . . . . . . . . . . . 34-78

Define Parameters at Suite Creation Time . . . . . . . . . . . . . . . . . . . 34-82

Create Simple Test Suites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-89

Run Tests for Various Workflows . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-91


Set Up Example Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-91
Run All Tests in Class or Function . . . . . . . . . . . . . . . . . . . . . . . . . 34-91
Run Single Test in Class or Function . . . . . . . . . . . . . . . . . . . . . . . 34-91
Run Test Suites by Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-92
Run Test Suites from Test Array . . . . . . . . . . . . . . . . . . . . . . . . . . 34-92
Run Tests with Customized Test Runner . . . . . . . . . . . . . . . . . . . . 34-93

xxx Contents

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy