suransys / omnistap

Unit testing framework for Omnis Studio
MIT License
15 stars 7 forks source link

Running tests from commandline when tests are seperate from the production library #8

Closed Frogli closed 6 years ago

Frogli commented 6 years ago

The past two days I am trying to run the unittests from the commandline, but is not quite working yet. I have the unittests in separate from the production library. If I then run the command

/Applications/Omnis Studio 8.1 RT.app/Contents/MacOS/bin/omniscli" gettests

I do get a list of my test, but when I do:

/Applications/Omnis Studio 8.1 RT.app/Contents/MacOS/bin/omniscli" runtests

I do not get the error that the TAP output folder is missing. An empty line is shown and the command prompt is shown again.

When I do the command below Omnis Studio is started, but never closes.

/Applications/Omnis Studio 8.1 RT.app/Contents/MacOS/bin/omniscli" runtests ~/Desktop

I have made two small libraries which demonstrates my problem and I put them in a GitHub repository.

What a I doing wrong?

Frogli commented 6 years ago

nvm today I tried it again it works... 😲 well kinda. It runs the tests, but Omnis Studio is not closed after that.

Frogli commented 6 years ago

Allright another update. My colleague pointed me in the right direction. The solution is:

  1. Subclass the startup task of the test library from omnistap.kgTAPTask
  2. Override the method $useSeparateTestLibrary
  3. Add line Quit method kTrue

The nice thing with this is. You do not have any code directly linked to omnisTAP or omnisCLI in the production library. I think it is a good idea to mention this in the Wiki. Could you add this for my @omnis-jedi / @barkingfoodog ?

Thanks again!

barkingfoodog commented 6 years ago

Good call. I've added instructions for manually setting up a separate testing library with the steps you outlined.