LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unit Test Framework code coverage

I am currently running units tests in a LabVIEW 2012 project and I need to proof 100% code coverage for all VIs tested.  I have a VI, which calls another VI that contains a True/False case structure.  The input for the subVI is hard coded as True so it is not possible for me to achieve 100% code coverage on the 2nd VI by purely testing the calling VI.  I have therefore set up a 2nd unit test which tests the False case.  However, if I run both unit tests in one run the test report only reports the coverage of my 2nd VI as part of the results for the second unit test.  However, I KNOW I have covered both cases in my tests combined.

Is there a setting I am missing which will correctly combine the coverage for both the tests, or is the only way round this to create test cases for both True and False in my 2nd Unit Test.

 

For these VIs it is not a big issue, but I have more complicated VIs I need to test where I will have similar issues.

0 Kudos
Message 1 of 5
(3,418 Views)

Dear Blue Silver,


Are you still struggling with this issue?  Is it possible for you to upload your code for me to take a look at so that I can try to help.


Kind Regards,

Robert Ward
Applications Engineer, NI
0 Kudos
Message 2 of 5
(3,335 Views)

I am afraid this has reared its ugly head again.  I urgently need to prove that I have 100% coverage for my VIs for audit.  Some VIs are subVIs and are therefore 100% covered by testing of their calling VIs.  When I was setting up the tests I was able to prove 100% coverage for all VIs.  I have run the Unit Test Framework and produced an single HTML report covering all the tests.  However, it is only reporting the coverage of the calling VI's and not their subVIs.  I have little time now to write a test for each VI.  Surely there is a way to report the coverage on EVERYTHING????

0 Kudos
Message 3 of 5
(3,280 Views)

I don't understand. If you aren't testing some VIs, why do you expect 100% coverage?

0 Kudos
Message 4 of 5
(3,266 Views)

When I run my tests the Unit Test Framework Results window, coverage tab, lists all my tests with the % coverage of the VIs tested, followed by a list of dependancies and the test coverage for these.  I was expecting the same information in the HTML report, but have discovered it is not there.  I need a way of presenting the information in the UTF Results window to non-LabVIEW users.

0 Kudos
Message 5 of 5
(3,243 Views)