LabVIEW 2013 Unit Test Framework Toolkit Help
»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.
Double-click a .lvtest file to display the Test Properties 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.
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.
Entering Input Values, Expected Values, and Comparison Types