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

Creating Tests (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 Project Explorer window to create tests interactively. You can create tests from VIs, existing .lvtest files, or user-defined test VIs.

Note   You must create and save a LabVIEW project before you can use the LabVIEW Unit Test Framework Toolkit to create tests. Use projects to group together all the files you need to perform unit testing.

When you create a test from the Project Explorer, LabVIEW creates a .lvtest file on disk. A .lvtest icon appears on both the Items and Files pages. Each .lvtest file contains the settings LabVIEW uses to check the VI under test for functional correctness.

Note  By default, LabVIEW saves .lvtest files in the same directory as the VIs under test. You can specify a different Default location file path on the Unit Test Framework page of the Project Properties dialog box.

Related Information

Tests and .lvtest Files

Creating a User-Defined Test VI

Creating a Test from a VI

Complete the following steps to create a test from a VI.

  1. Open the LabVIEW project that contains the files on which you want to perform unit testing.
  2. Right-click a VI and select Unit Tests»New Test from the shortcut menu.
    Note  You also can create tests from multiple VIs by pressing the <Ctrl> key while clicking each VI. Then right-click the selection and select New Unit Tests from the shortcut menu. LabVIEW creates a .lvtest file for each VI.
  3. Configure the .lvtest file you just created.
  4. Select File»Save to save the project.

Related Information

Configuring Tests

Creating a Test from a .lvtest File

Complete the following steps to create a test from a .lvtest file on disk.

  1. Open the LabVIEW project that contains the files on which you want to perform unit testing.
  2. Right-click a VI and select Unit Tests»Add Test from File from the shortcut menu. A file dialog box appears.
  3. Navigate to and select the .lvtest file you want to use. Click the OK button. LabVIEW adds the .lvtest file to the project tree.
    Note  If the .lvtest file was associated with a different VI previously, the .lvtest file now is associated with the new VI. You can specify only one VI under test for each .lvtest file.
  4. Select File»Save to save the project.

Creating a Test from a User-Defined Test VI

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

  1. Open the LabVIEW project that contains the files on which you want to perform unit testing.
  2. Right-click a VI and select Unit Tests»New User-Defined Test from the shortcut menu. A Save dialog box appears.

    LabVIEW automatically creates a user-defined test VI from the User-Defined Test Template.vit file located in the labview\templates\UnitTestFramework directory. You also can find the template file by selecting File»New to display the New dialog box and selecting VI»From Template»Unit Test Framework.
  3. Enter a filename for the user-defined test VI.
  4. Click the OK button to save the user-defined test VI.

    LabVIEW automatically creates a test and configures the test to use the user-defined test VI. LabVIEW saves the .lvtest file in the same location as the user-defined test VI.
  5. Select File»Save to save the project.
  6. Modify the user-defined test VI to define your own test.

Related Information

Creating 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