Exchanging Values Between the VI under Test, Setup VI, Teardown VI, and the Test Cases Page
- Updated2025-11-07
- 3 minute(s) read
You can modify the input and expected values by using the front panel of the VI under test, setup
VI, and teardown VI and then importing these values to a test case. You also can
export values from a test case to the VI under test, setup VI, and teardown VI.
Note LabVIEW lists the
controls and indicators from the VI under test on the Test Cases
page. If the Input/output values setting on the
Unit Test Framework page of the Project
Properties dialog box is Include controls and
indicators from connector pane, make sure you select a connector
pane pattern and assign the terminals for the VI under test.
Complete the following steps to exchange values between the VI under test, setup VI, teardown VI, and the Test Cases page:
- Open the LabVIEW project that contains the files on which you want to perform unit testing.
-
Double-click an .lvtest file.
The Test Properties dialog box displays.
-
Select Test Cases from the
Category list.
The Test Cases page displays.
- If this test has more than one test case, use the Test Case control to select the test case you want to configure.
-
Click the Export Values to VI button
to
export the input and expected values from the current test case to the VI under
test, setup VI, and teardown VI. The VI under test, setup VI, and teardown VI
open in a separate window.
Tip Use the Export Values to VI button to open the VI under test while configuring a test. - From the front panel of the VI under test, setup VI, and teardown VI, modify the values of any controls and indicators you want to configure.
-
On the Test Properties dialog box, click the
Import Values from VI button
to
import values from the VI under test, setup VI, and teardown VI to the current
test case.
Note When you import values from the VI under test, setup VI, and teardown VI, LabVIEW replaces the input and expected values of the current test case with the values of the corresponding terminals in the VI under test, setup VI, and teardown VI. - Select a comparison type from the Comparison list of the output terminal you want to configure. Repeat this step for other output terminals.
- Click the OK button to close the dialog box and return to the Project Explorer window.
- Select to save the project.
The next time you execute this test, LabVIEW runs the setup VI and VI under test by using the input values you specified for each test case in the .lvtest file. LabVIEW then compares the resulting values with the expected values of the VI under test and teardown VI by using the comparison types you specified.