MaxUnit

BlitzMax Forums/Brucey's Modules/MaxUnit

Macguffin(Posted 2008) [#1]
Hey all,

Working on setting up MaxUnit in BLIde, and I was curious if anyone else has done so for any of their projects, and how they organized things.


ziggy(Posted 2008) [#2]
After coping the files in the appropiate folder, open maxunit.bmx file and build the module (f5)
After that, restart BLIde updating modules cache and it should be running ok.


Macguffin(Posted 2008) [#3]
I'm sorry, Manel - I was too vague. I'm trying to figure out how to organize things at a project level.

For instance, right now I've simply got the relevant Include and Import calls in my main build file with a conditional to build it in debug. Eventually, I could see this getting unwieldy - I have to run my whole test suite every time I rebuild debug.

I looked at doing it as a separate .exe under the same project, but that led to all sorts of interesting issues with the Strict declaration and double-declared globals.


Brucey(Posted 2008) [#4]
It is for Unit Testing, which is a way of breaking your source into individual parts and running separate tests on those parts.
Used well, it should make your code, and subsequent modifications to that code, bullet-proof. :-p

There's a small example here.

It's based on JUnit, a reasonably well known java unit testing library.

Alas, a lot of people never bother to properly test their code....


Brucey(Posted 2008) [#5]
Macguffin. You probably want to design your code with testing in mind, if you can.
It's easier to test from the start, rather than try and back-fit a testing framework later on. (I know, I've had to do it!)

There's nothing preventing you splitting the testing itself into separate apps if you need to, and have issues with importing and suchlike.
One of the problems with BlitzMax is its unfortunate inability to cross-import modules - which leads to having lots and lots of Types/code in one large file.


I'm also interesting in building a "Mock" testing framework, but I'm not sure that BlitzMax is flexible enough for that.


Muttley(Posted 2009) [#6]
Ahahaha.

I've just been adding some tests to my INI File Handler module in preperation for a small overhaul, and doing so has so far uncovered at least one new bug that I was totally unaware of.

Fantastic stuff Brucey. I owe you a beer. :)

Muttley