07-24-2009 10:03 AM
Hi,
I have a large project that I would like to test using test software rather than manually go through each piece of code and test it.
My application is based around a queued state machine architecture which uses lots of loops, event structures and other items that wait for a user input.
The Unit Test Framework looks like a great tool to manage testing of small units, highlight broken code when changes are made and document testing.
I have tried to set up some tests in Unit Test Framework to test my basic modules. So far it seems great at very simple vi's that perform a calculation or comparison, but once it comes to user input it no longer works so well.
When there is a user input required(e.g. click OK), the vi opens and waits for me to click the button to continue.
This is OK, but is there a way to click the button programatically through Unit Test Framework?
or do I need to write my own test vi for this instance?
ALSO: Why when I have revision history on in Labview does it pop up a window for NI Unit Test VI's every time I make a change? Surely this is a bug?
08-03-2009 04:59 PM
There is no way to specify interactions with the user interface in the Unit Test Framework right now.
Bringing up the revision history dialog indeed seems to be a bug. CAR 181717.
Herbert
08-04-2009 03:48 AM
Hello Stubon,
When working with Event Structures that require user input, the VI will operate just as you have described: The unit-test will wait for an input to continue, unless some timeout event is also reached. In these cases, it is possible to use a User-Defined Test.
The user-defined test allows users to create a test VI which will output a Boolean value to instruct the Unit Test Framework whether a specific test has passed or not. In the User-Defined test vector, users can programmatically finish the loop or generate some events.
This can act as a starting point.
Regards,
01-05-2010 02:58 AM
Hi,
I'm not very clear about the revision history dialog problem. Do you mean when you make a change to your VI, LabVIEW will popup the revision histroy window?
LabVIEW provide a option for every VI about this. Open VI Properties dialog, select Revision History category, you'll find the option. If you check out "Prompt for a comment when the VI is saved", when you save a VI, LabVIEW will pop up the revision histroy window.
If this is not what you mean, can you tell me how to reproduce this bug? what OS and which version of Unit Test Framework toolkit are you using?