JKI Discussion Forums
Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Running Tests for a Project Rate Topic: -----

#1
User is offline   JKI 

  • Group: JKI Team
  • Posts: 201
  • Joined: 10-July 06
  • Gender:Male
Please watch this short tutorial on how to run unit tests from VI Tester. After watching the video, you can follow them step by step in the walk through below.



Open the VI Tester example project located at:

  • \examples\JKI\VI Tester\VI Tester Example.lvproj
The example project, shown below contains two TestCase classes:

Attached Image: monthly_01_2009/post-7-1232224182.png

Expand the "Merge Errors TestCase.lvclass" class in the tree to show the class members. You will find several member VIs whose names all begin with "test" -- these are unit tests that validate functionality of the "Merge Errors" VI that ships with LabVIEW. We'll look at these later. Now, let's run all the tests.

Launch the VI Tester user interface by selecting Tools >VI Tester > Test VIs... from the menubar of the Project Explorer window. VI Tester will then inspect the project for all unit tests and show them in the Test Hierarchy window, as shown below.

Attached Image: VI_Tester___Example_Project_Tests_in_VI_Tester.png

Press the 'Run All Tests' button to run all of the unit tests.

Attached Image: monthly_01_2009/post-7-1232224929.png

This will run all of the tests, showing the results.

Attached Image: All_Tests_Have_Run.png

The following glyphs are used to show the status of each test:

  • Attached Image: monthly_01_2009/post-7-1232225583.png - Test Passed
  • Attached Image: monthly_01_2009/post-7-1232225578.png - Test Failed
  • Attached Image: monthly_01_2009/post-7-1232225586.png - Test Skipped
  • Attached Image: monthly_01_2009/post-7-1232225643.png - Test Not Run
You can double-click any of the tests, to open it. Double-click on the "test no error in" test in the "Merge Errors TestCase". This will open "Merge Errors TestCase.lvclass:test no error in.vi", as shown below:

Attached Image: Open_Test_Case_VI.png

You can see that the "Enabled" frame of the Diagram Disable Structure calls "TestCase.lvclass:skip.vi" -- this is why the test shows the Test Skipped (Attached Image: monthly_01_2009/post-7-1232225586.png) icon in VI Tester. Enable the other frame of the Diagram Disable Structure, as shown below:

Attached Image: Enable_Test.png

The re-run the test to see that it is no longer skipped.

Interested, and want to see more?
Why not learn how to add new Test Cases to a Project?
0 kudos

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked