vipm-io / vi-tester

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

Vi Tester will not find any of my new test cases #29

Open Nirvana-1 opened 5 years ago

Nirvana-1 commented 5 years ago

Hello,

This may be a basic problem that I have missed somewhere but when I create new test cases and save them in the same place as the previous ones(Working just fine) VI Tester doesn't seem to be recognising them as test cases.

They begin with test and I have followed every tutorial I have found yet it still won't work.

Has anyone ever encountered this before?

I'm new to labview and this is taking me too long to solve.

Thanks

kosist commented 5 years ago

@Nirvana-1, question is how do you create your test cases? Check, if they have same class/parent hierarchy, as working one. Or, the best would be, if you could post here the code, which causes issues.

samsharp99 commented 4 years ago

You need to make sure you have saved your Unit Test class after adding the new test VI. The VI Tester looks at the VIs in the class and the class file only gets updated/included when you save the .lvclass file. Doing a Save All... on the project is the easiest way to do this.

RossSmyth commented 2 years ago

I just started using VI Tester today and the GUI has not been able to find any of my test cases at all from the moment I made my first one. Currently my project tree looks like:

Project/
├─ Project/
├─ Tests/
│  ├─ Unit/
│  │  ├─ Test1
│  │  ├─ Test2
│  │  ├─ Test3
│  ├─ Integration/

And the file structure looks like

Project/
├─ Project/
├─ Tests/
│  ├─ Unit/
│  │  ├─ Test1/
│  │  │  ├─ Test1.lvclass
│  │  ├─ Test2/
│  │  │  ├─  Test2.lvclass
│  │  ├─ Test3/
│  │  │  ├─  Test3.lvclass
│  ├─ Integration/
├─ project.lvproj

If that is relevant. I have saved my project.

RossSmyth commented 2 years ago

I discovered two things. I am relatively new to LabVIEW and the documentation says:

To create new tests, save a new copy of "testExample.vi" using the "Open additional copy" option of the "Save As" dialog. Make sure to check the box that says 'Add copy to {MyTest}.lvclass' where {MyTest} is the test you created.

Which I did exactly that. But after spending a couple of hours digging into the graphical VI Tester front-end I discovered that there is a regex that it uses to select methods. This was the part that was not selecting my tests. And so I found out two things:

  1. *.vit and *.vi, while LabVIEW does nothing to tell you this for the most part, are not the same even if they operate the same when developing them. So when I did the above "Save As" copy of "testExample.vit" I just made a new wrong vi, what I later found out to be template vis.
  2. Your test methods must start with "test"

I think it would good if the documentation was updated to reflect these as it is not in the documentation currently. @jimkring

Thanks.