Unit tests

What is the best way to implement unit testing within Xojo?
Is it to create a second project and link to the classes of the main project?

As a side question, are there any plans to add a Test target to the IDE so that we can easily create unit tests within our projects, without having to create another project just to accomplish this? Most dev companies these days insist in unit testing as part of the development process (or at least, the ones I have come across), and it would be a real bonus to create a target, as we do for operating systems from with one IDE.

It not clear from your post if you know about the XojoUnit project, so here is a link in case:

https://github.com/xojo/XojoUnit

We implement unit testing directly in our projects, but you could certainly create a separate app and link the classes.

Hi Kem, yes I am aware of the XojoUnit… I actually use it at the moment. I was just wondering:
a: what other peoples approaches are, the current method I have of creating a second project and importing the classes to test seems somewhat cumbersome
and b: if it would ever be integrated into the IDE (like Xcode and Visual Studio both do)

Our main console app works like a shell for other apps, and one of those is for unit testing. When we call our main app, we use this form:

mainapp <--switches> subapp <--switches>

Se we can do either mainapp unit-test or mainapp unit-tests 'TestName' …

For our GUI app, unit testing is accessible through a menu only admins can see.

When we write a new function, we add the unit tests for it immediately.*

  • “Immediate” may not be immediate. :slight_smile: