xkenneth Posted June 30, 2009 Report Share Posted June 30, 2009 All, I'm writing a multi-platform, multi-language enterprise application that includes the use of LabVIEW code. I'd like to be able to test my LabVIEW code using the VI Tester integrated into my integration server. In order to do this I need to be able to programatically call the VI tester (either from LabVIEW or some scripting language, preferably python) and report test results. What are my options for this? Regards, Ken Link to comment Share on other sites More sharing options...
Omar Mussa Posted June 30, 2009 Report Share Posted June 30, 2009 In order to do this I need to be able to programatically call the VI tester (either from LabVIEW or some scripting language, preferably python) and report test results. What are my options for this? Currently, the best way to run your tests is to programmatically call VI Tester's Run Tests.vi. This VI will return the results as a string and will return a success/fail boolean. The VI is polymorphic and supports a lot of different input types. For an integration server, I would recommend creating a TestSuite that you can call that will include the tests you have validated for your application. That way you don't get any spurious results from tests under development. As for calling the VI from another language, there are existing tools to use Python to call LabVIEW... Let us know if you have any feedback or suggestions once you get started that would make this process easier for you! Link to comment Share on other sites More sharing options...
Jim Kring Posted July 1, 2009 Report Share Posted July 1, 2009 All, I'm writing a multi-platform, multi-language enterprise application that includes the use of LabVIEW code. I'd like to be able to test my LabVIEW code using the VI Tester integrated into my integration server. In order to do this I need to be able to programatically call the VI tester (either from LabVIEW or some scripting language, preferably python) and report test results. What are my options for this? Regards, Ken Hey Ken, I'm really eager to hear more about how VI Tester plays a role in your continuous integration process. We're happy to help answer any questions and brainstorm on ideas, so don't hesitate to ask... Regarding calling VI Tester from Python, there are certainly a lot of ways to do this. If you're on Windows, the easiest way might be to use ActiveX. Here's an example of how to run some a Test Case from Python using ActiveX: # initialize the path to your test: this is just an example test case myTest = r"C:\Program Files\National Instruments\LabVIEW 8.2\examples\JKI\VI Tester\Queue TestCase\Queue TestCase.lvclass" # connect to LabVIEW import win32com.client labview = win32com.client.Dispatch("LabVIEW.Application") # get VI reference to 'Run Tests (Path).vi' VI = labview.GetVIReference(r'C:\Program Files\National Instruments\LabVIEW 8.2\vi.lib\addons\_JKI Toolkits\VI Tester\VI Tester API.llb\Run Tests (Path).vi') # run the unit test by calling the Run Tests VI returnVals = VI.Call(["Test Path", "successful?", "test details"],[myTest,"",""]) # get pass/fail Boolean (pass = TRUE) passAllTests = returnVals[1][1] # get test details string testDetails = returnVals[1][2] # disconnect from LabVIEW labview.Quit() Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.