Page 1 of 1

PureUnit -- automated testing framework for PureBasic

Posted: Sun Sep 09, 2007 11:34 pm
by freak
PureUnit is a testing framework with similar concepts as other xUnit frameworks like JUnit.
It can be used to test your procedures, includefiles or userlibraries or to
do so called "test driven development", where you first write the test for
a procedure and then implement the actual code until the test succeeds.

It comes as a simple set of macros for writing the testcode and a tool
to executed the tests and report the progress/status of the tests.
It is designed to run as a standalone GUI program, to be integrated into
the IDE as a tool or to run from the console, a script or a makefile.

PureUnit requires a 4.10 compiler or newer. (the beta versions will work)
Currently there is a Windows and Linux executable available. A version
for OSX will be provided when there is a 4.10 compiler for OSX.

This started as a small project for me to have a way to easily create and manage
testcodes for the PureBasic library commands, but as is sometimes the case
with my projects, i went into overkill mode and produced a quite useful piece
of software that i don't want to keep away from you guys ;)

Note: We have not decided yet wether this will be a part of the official PB package,
or if i will just release it as a private sideproject. (means less support work).
For now consider this beta, as it has not been tested that intensly yet,
i will keep updating/bugfixing this in any case though, as we use it for our own
development work as well.


You can download the tool here: http://freak.purearea.net/tools/PureUnit03.zip

Please read the 'Readme.txt' and the example for instructions.
Any feedback is welcome...

Posted: Mon Sep 10, 2007 12:10 am
by DoubleDutch
This is a really good idea, especially for those creating libs using tailbite.

Thanks. :)

Posted: Mon Sep 10, 2007 4:27 pm
by dontmailme
This has got to be part of the official PB releases......

It's a professional tool and will help to promote PB as a professional product, which IMHO, it is :D

Posted: Mon Sep 10, 2007 7:16 pm
by Comtois
Thank you. It's a great tool :)

Posted: Tue Sep 11, 2007 3:31 am
by johnfinch
Excellent! Must be part of the full release, surely... great developers aid.
Thank you

Posted: Sun Mar 22, 2009 9:08 am
by Little John
Thank you for this great tool!
I use it for testing all my important include files. It was a good decision to add PureUnit to the official release.

Just a minor suggestion: Maybe you can add a minimize button to the title bar?

Regards, Little John

Re: PureUnit -- automated testing framework for PureBasic

Posted: Thu Feb 23, 2017 8:19 pm
by #NULL
is it possible to use PureUnit in combination with console commands? as soon as my test code contains a PrintN() then PureUnit hangs up and i have to kill it. i tried with PureUnit.exe and PureUnitGui.exe, both with and without the --gui argument.
for example this code file:

Code: Select all

ProcedureUnit mytest()
  
  OpenConsole("title")
  PrintN("bla")
  
  Assert(1 = 1, "fine")
  
EndProcedureUnit
saved as 'test_PureUnit.pb' and then the following run in cmd from the directory containing the the test code:

Code: Select all

"C:\Program Files\PureBasic_5_60_b6\SDK\PureUnit\PureUnitGui.exe" --compiler "C:\Program Files\PureBasic_5_60_b6\Compilers\pbcompiler.exe" --gui test_PureUnit.pb
the tool opens and begins its work but then does not respond. it works if i comment out the PrintN().

ps:
the same result if i open PureUnitGui.exe directly from the explorer and choose the file.