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

Creating a User-Defined Test VI (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)

Complete the following steps to create a user-defined test VI.

  1. Create a user-defined test VI from the User-Defined Test Template.vit file in one of the following ways:
    • Select File»New to display the New dialog box and select VI»From Template»Unit Test Framework to open the User-Defined Test Template.vit file. You also can locate this file in the labview\templates\UnitTestFramework directory.
    • Create a test from a user-defined test VI. The test and user-defined test VI appear in the Project Explorer window. Right-click the user-defined test VI and select Open.
  2. Modify the VI to define your own test. Keep in mind the following requirements for the user-defined test VI:
    • Do not modify the Unit Test Framework Result indicator name or cluster elements.
    • The Unit Test Framework Result indicator contains the following three cluster elements:
      Element Name Data Type Notes Required
      time elapsed [ms] Numeric indicator Time in milliseconds. No
      result (test) Enum Enum values must be Passed, Failed, Error, Skipped, and Not Processed. Yes
      result (parameters) Array of cluster Each array is a cluster of comparison results between the expected and resulting values. No
      Note: You must include data from this element in the Unit Test Framework Result indicator.
    • The Unit Test Framework Result indicator must be connected to the connector pane.
  3. Wire the result of your test to the result (test) element.
  4. (Optional) For advanced test VIs, wire the results of your tests to the time elapsed [ms] and results (parameters) elements.
  5. Select File»Save As to save this user-defined test VI in an easily accessible location.
    Note  If you rename a user-defined test VI that you create from the shortcut menu, you must specify the new User-defined test VI file path on the Configuration page of the Test Properties dialog box.

Refer to the labview\examples\Unit Test Framework\User-Defined Test\User-Defined Test.lvproj for an example that demonstrates how to use the Unit Test Framework Toolkit to create user-defined test VIs.

Related Information

Creating a Test from a User-Defined Test VI


 

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