09-09-2009 06:46 PM
Is it possible to package the Unit Test Framework into an EXE? I would like to pass a project file path and report file path to an exe that will reside on a dedicated test server and run Unit Tests or User Defined tests that are included in the project file.
I want to use this EXE to run automatic tests that can be triggered by a CI server, like Cruise Control.
Is there a limitation with a toolkit, or the UTF specifically, that prevents packaging into an EXE?
Solved! Go to Solution.
09-10-2009 05:02 PM
Hi b_hall,
There is a UTF Palette under Programming that contains VIs to allow you to run tests, show results, and create reports programmatically. You should be able to create an EXE using these VIs that does what you describe. Plus, since you can create or customize your .LVTEST files, it gives you exe some more flexibility in terms of tests to run.
Be aware that you are not able to package a Unit Test with an executable; only Installers, Source Distributions, and Zip Files work.
09-10-2009 05:53 PM
You cannot run the Unit Test Framework as a standalone executable. It uses a lot of functionality that is part of the LabVIEW Development System, but not the LabVIEW Runtime Engine (e.g. to in order to process block diagrams, project files).
What you can do in order to solve your use case is install LabVIEW to your test machine and have it run a VI that executes your tests. There are several ways of starting up and controlling LabVIEW, including a command line interface that lets you pass in a VI name to run plus parameters for the VI. A more granular way of controlling LabVIEW would be through ActiveX, which can be achieved e.g. in a VB Script or JavaScript ran by the Windows Scripting Host.
This piece of VBScript for example takes 2 inputs from the command line, starts up LabVIEW, loads a VI, passes the values to the VI and runs the VI. It will wait until LabVIEW is finished (optional). You also can choose to keep LabVIEW running all the time, or to have the script open and close it as needed.
Dim oLV Set oLV = CreateObject("LabVIEW.Application") sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") Dim oVI Set oVI = oLV.GetVIReference(sCurPath&"\LVDiff.llb\Diff_VI.vi") oVI.SetControlValue "Input 1", WScript.Arguments(0) oVI.SetControlValue "Input 2", WScript.Arguments(1) On Error Resume Next oVI.Run(0) If Err.Number>0 Then oVI.Abort MsgBox "Error" End If
Hope that helps,
Herbert
09-11-2009 12:20 PM
Hi Herbert,
Thanks for the response.
The examples you suggested are actually what we were trying/considering (command line and Active X options). We were looking for a way to use it standalone (without the full dev environment) but have since decided to abandon that effort since it doesn't seem to be a workable solution.
I appreciate the VBScript code snippet as well.
Regards,
Brian