LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to run unit tests on event-driven VIs

Hello,

 

I'm trying to construct some unit tests for my program, but my VI has event structures in it.

 

How does one construct test cases that exercise the event structures?

 

All of the documentation refers to various tools and methods for setting up the inputs and reading the outputs of a VI, but nothing about driving user-interface events.

 

Can anyone help?  Has anyone else done this?

 

Thanks!

0 Kudos
Message 1 of 6
(3,040 Views)
You should be able to generate most UI events. One glaring exception would be buttons with latching mechanical actions. Those will be a problem because you can't fire value change events on them programmatically.

Do you have specific concerns?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 6
(3,008 Views)

Mike,

 

Thanks for the reply.

 

My concern is that I don't understand HOW to generate the UI event in a unit test.

 

I don't see any method for doing it in either the test framework or in the documentation.

 

Thanks!

0 Kudos
Message 3 of 6
(2,996 Views)
The basic interface is provided by VI Server. With a reference to a VI you can get a reference to any control or indicator on its front panel. With the control references you can fire value change events by writing to a control's Value(Signalling) property.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 6
(2,971 Views)

ok, so I have to go research VI server - I've never used it.  Do you have a tutorial or a reference I can go study for how to integrate VI server into the unit test framework?

 

Thanks,

 

-Ron

0 Kudos
Message 5 of 6
(2,935 Views)
Specifically with the UTF, no. But once you understand how VI Server works it should be pretty evident how they can fit together.

What sort of events does your UI event structure handle?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 6
(2,926 Views)