´╗┐
Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Configuring Tests to Run Setup and Teardown VIs (Unit Test Framework Toolkit)

LabVIEW 2013 Unit Test Framework Toolkit Help

Edition Date: June 2013

Part Number: 372584F-01

»View Product Info
Download Help (Windows Only)

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.

  1. Open the LabVIEW project that contains the files on which you want to perform unit testing.
  2. Double-click a .lvtest file to display the Test Properties dialog box.
  3. Select Setup/Teardown from the Category list to display the Setup/Teardown page.
  4. Click the Browse button next to the Setup VI text box. A file dialog box appears.
  5. Navigate to and select the VI you want to use as the setup VI. Click the OK button.
  6. Select an output terminal from the Outputs of Setup VI column for each Inputs of VI under Test you want to pass values to.
  7. Click the Browse button next to the Teardown VI text box. A file dialog box appears.
  8. Navigate to and select the VI you want to use as the teardown VI. Click the OK button.
  9. Select an input terminal from the Inputs of Teardown VI column for each Outputs of VI under Test you want to retrieve values from.
  10. Enter the input values, expected values, and comparison types of the setup and teardown VIs for a test case.
  11. Click the OK button to close the dialog box and return to the Project Explorer window.
  12. 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.

Related Information

Entering Input Values, Expected Values, and Comparison Types


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit