
Télécharger PureUnit
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.
Et voici un premier exemple de rapport
Code utilisé pour le rapport ci-dessus
Code : Tout sélectionner
; Set the options. This Code will be compiled/tested once normally and once with the OpenGl subsystem:
;
PureUnitOptions(NoUnicode, SubSystem[OpenGl])
; called once on program start
;
ProcedureUnitStartup startup()
UnitDebug("Startup...")
EndProcedureUnit
; called once on program end
;
ProcedureUnitShutdown shutdown()
UnitDebug("Shutdown...")
EndProcedureUnit
; Same goes for ProcedureUnitBefore / ProcedureUnitAfter
; Here comes our test procedure
;
ProcedureUnit mytest()
Assert(#True <> #False, "If this fails, the world has gone crazy :)")
For i = 1 To 10
Continue
Fail("This point should never be reaced")
Next i
; here our test will fail.
Assert(#True = #False, "This is bound to fail!")
EndProcedureUnit