vipm-io / vi-tester

VI Tester for LabVIEW
BSD 3-Clause "New" or "Revised" License
28 stars 26 forks source link

Add "New -> Test" menu for Test Case classes #59

Open kosist opened 3 years ago

kosist commented 3 years ago

Not sure whether it is possible to modify by custom project provider default menus, but the idea is to add to "New" menu of Test Case class new item "Test method" or something - so it will create new test method.

image

Sometimes template test method VI could be removed, or modified so then can not be used for different tests. But as test method is just simple static dispatch VI, it would be more "natural" way of adding test via "New" menu for the test class.

And, that generated new test method could contain some code already - either the same as template test, or "Given, When, Then" template from VITAC toolkit.

kosist commented 3 years ago

@jimkring , would you mind if it will be separate tool? I might work on this feature, but the question is whether you have time now to build new release of VI Tester. So instead of adding this menus to VI Tester, it could be done and released as separate package which will be dependent on VI Tester, and add new menu item as described above.

jimkring commented 3 years ago

Hi @kosist. Let's add this to the main package. We already have a project provider. I'm happy to help with the build and release.

kosist commented 3 years ago

Thank you @jimkring, then I'll go for it, and create pull request when it will be finalized.

jimkring commented 3 years ago

Sounds great!

kosist commented 3 years ago

@jimkring , let me ask you please about the following. When I open "VI Tester Project Integration.lvproj", there are missing VIs from API folder. Should I place first the whole project to "C:\Program Files (x86)\National Instruments\LabVIEW 2013\resource\Framework\Providers" folder? Because seems that it searches "API" folder one level upper.

image

I've checked .gitignore file, and API folder is not there - so seems that "LabVIEW Project Plugin" was placed to "...\Providers" folder, wasn't it? I could also relink all API VIs/controls which are missing to new location, but not sure whether it could cause then some issues while building package.

jimkring commented 3 years ago

@kosist this part of LabVIEW development has historically been (and continues to be) a pain.

Starting in LV2012 (I think), the <LabVIEW>\resource folder has been a Symbolic Path, meaning if a VI calls a VI that's located underneath the <LabVIEW>\resource folder, then the caller will save the dependency VIs path relative to <resource>. Based on that, I'm not sure why the linkages are bad, since we're working in LV2013.

I can take a look...

jimkring commented 3 years ago

Ok, I've sort of figured it out. It's going to be a little strange, but I think we'll get it working.

For now, let's ignore the LabVIEW Project file.

First, I've committed some changes to the master branch.

Second, lets do your development in a feature branch named Provider-New-Test-Menu. We can then merge into master once it's ready.

Finally, I verified that I can run the provider from source code and build it.

I've documented how you can do this, here:

https://github.com/JKISoftware/JKI-VI-Tester/wiki/VI-Tester-Development-Guide

For starters, see if you're able to load the project provider from source code. This will enable to you do development.

Thanks and let me know how it goes.

kosist commented 3 years ago

Thanks a lot! Now dependencies are correct - I've placed also VIs and ini file to Providers... folder, and Project Provider was loaded properly. Just, I didn't see items in Tools menu - so going to check why it is not there... Things are not so easy than it seemed before )))

jimkring commented 3 years ago

That's great that it seems to be working.

As for the Tools menu, one thought that I have is that maybe you didn't first install the built VI Tester package (e.g. the latest in VIPM) into LabVIEW 2013 -- this as in the instructions for development of the project provider state, as an early/first step.

Doing this step should put the tools menu items in the right spot. Then, in a subsequent step, you delete the installed project provider and put your provider source code in its place.

Hope that helps. Yes, it's not so easy :)

kosist commented 3 years ago

Sorry, my fault - I wasn't aware about developer's guide... Now I see )) Thanks a lot! Btw, there is issue with installing of latest VI Tester package via VIPM (v3.0.0.294-1), I'll post issue about it... Previous build (v3.0.0.292-1) works fine.

jimkring commented 3 years ago

No problem. Yes, the Developer's Guide is quite long and very detailed, since there are lots of ways to get things to not work properly :))

Glad you're you're figuring it out.

Regarding the installation issues with the latest package, yes, please let me know about any issues and probably we can fix that, in this next next release 👍