LabVIEW 2009 Unit Test Framework Toolkit Help
Edition Date: June 2009
Part Number: 372584B-01
»View Product Info
Use the Setup/Teardown page of the
Test Properties dialog box to configure tests to run setup and teardown VIs. You also can configure tests to run setup and teardown VIs by
editing .lvtest files
.
Complete the following steps to configure a test to run setup and teardown VIs.
-
Open the LabVIEW project that contains the files on which you want to perform unit testing.
-
Right-click a .lvtest file and select Properties from the shortcut menu to display the
Test Properties dialog box. You also can double-click the .lvtest file to open the dialog box.
- Select Setup/Teardown from the Category list to display the Setup/Teardown page.
- Click the Browse button next to the Setup VI text box. A file dialog box appears.
- Navigate to and select the VI you want to use as the setup VI. Click the OK button.
- Select an output terminal from the Outputs of Setup VI column for each Inputs of VI Under Test you want to pass values to.
- Click the Browse button next to the Teardown VI text box. A file dialog box appears.
- Navigate to and select the VI you want to use as the teardown VI. Click the OK button.
- Select an input terminal from the Inputs of Teardown VI column for each Outputs of VI Under Test you want to retrieve values from.
- Enter the input values, expected values, and comparison types of the setup and teardown VIs for a test case.
-
Click the OK button to close the dialog box and return to the Project Explorer window.
-
Select File»Save to save the project.
The next time you execute this test, LabVIEW first runs the setup VI by using the input values and then passes the output values from the setup VI to the inputs of the VI under test. LabVIEW then checks the VI under test for functional correctness and passes the resulting values from the VI under test to the inputs of the teardown VI. LabVIEW compares the outputs of the teardown VI with the expected values.
 |
Note If the teardown VI has an error out indicator, and the indicator contains an error, LabVIEW lists this test on the Test Errors page of the Unit Test Framework Results window instead of the Test Results page. |
Refer to the labview\examples\Unit Test Framework\Setup Teardown\Setup Teardown.lvproj for an example that demonstrates how to use setup and teardown VIs.