LabVIEW 2009 Unit Test Framework Toolkit Help
Edition Date: June 2009
Part Number: 372584B-01
»View Product Info
Use the
Project Explorer window to create tests interactively. You can create tests from VIs, existing .lvtest files, or user-defined test VIs.
 |
Note
You must create and save a LabVIEW project before you can use the LabVIEW Unit Test Framework Toolkit to create tests. Use projects to group together all the files you need to perform unit testing.
|
When you create a test from the Project Explorer, LabVIEW creates a .lvtest file on disk. A .lvtest icon appears on both the Items and Files pages. Each .lvtest file contains the settings LabVIEW uses to check the VI under test for functional correctness.
 |
Note By default, LabVIEW saves .lvtest files in the same directory as the VIs under test. You can specify a different default location file path on the Test Cases page of the Project Properties dialog box. |
Creating a Test from a VI
Complete the following steps to create a test from a VI.
-
Open the LabVIEW project that contains the files on which you want to perform unit testing.
- Right-click a VI and select Unit Tests»New Test from the shortcut menu.
 |
Note You also can create tests from multiple VIs by pressing the <Ctrl> key while clicking each VI. Then right-click the selection and select New Unit Tests from the shortcut menu. LabVIEW creates a .lvtest file for each VI. |
-
Configure the .lvtest file you just created.
-
Select File»Save to save the project.
Creating a Test from a .lvtest File
Complete the following steps to create a test from a .lvtest file on disk.
-
Open the LabVIEW project that contains the files on which you want to perform unit testing.
- Right-click a VI and select Unit Tests»Add Test from File from the shortcut menu. A file dialog box appears.
- Navigate to and select the .lvtest file you want to use. Click the OK button. LabVIEW adds the .lvtest file to the project tree.
 |
Note If the .lvtest file was associated with a different VI previously, the .lvtest file now is associated with the new VI. You can specify only one VI under test for each .lvtest file. |
-
Select File»Save to save the project.
Creating a Test from a User-Defined Test VI
Complete the following steps to create a test from a user-defined test VI.
-
Open the LabVIEW project that contains the files on which you want to perform unit testing.
- Right-click a VI and select Unit Tests»New User-Defined Test from the shortcut menu. A Save dialog box appears.
LabVIEW automatically creates a user-defined test VI from the utf_user_defined_test Template.vit file located in the
labview\resource\Framework\Providers\utf directory.
- Enter a filename for the user-defined test VI.
- Click the OK button to save the user-defined test VI.
LabVIEW automatically creates a test and configures the test to use the user-defined test VI. LabVIEW saves the .lvtest file in the same location as the user-defined test VI.
-
Select File»Save to save the project.
- Modify the user-defined test VI to define your own test.