Code: Select all
; Set the options.
; PureUnitOptions(NoUnicode, SubSystem[OpenGl])
; called once on program start
ProcedureUnitStartup startup()
UnitDebug("Startup...")
EndProcedureUnit
; called once on program end
ProcedureUnitShutdown shutdown()
UnitDebug("Shutdown...")
EndProcedureUnit
; Here comes our test procedures
ProcedureUnit passingtest()
UnitDebug("passingtest...")
Assert(#True = #True, "This should pass.")
EndProcedureUnit
ProcedureUnit failingtest()
UnitDebug("failingtest...")
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
Code: Select all
Using compiler: PureBasic 5.71 beta 1 LTS (Windows - x64)
Preparing file: DemoTest.pb
Compiling with: (no parameters)
Compiling with: /UNICODE
Stats: 0 successful tests in 1 files. (0 min, 35 sec)
Code: Select all
PureUnit - Test report
Statistics:
Date: 06/15/2019 - 12:19:22
PureUnit Version: PureUnit 1.1 - (c) 2016 Fantaisie Software
Compiler Version: PureBasic 5.71 beta 1 LTS (Windows - x64)
Operatingsystem:
Testfiles: 1 (1 correct, 0 with errors, 0 skipped)
Successful tests: 0
Failures: 0
Parser Warnings: 0
Options: Resume tests after errors.
Testing time: 0 minutes, 34 seconds
Status: All tests completed.
Base Directory:
P:\Unit Tests\
Correct files:
DemoTest.pb
1) The passing test should always work so I'm expecting 2 passes.
2) The 'failingtest' procedure has a static assertion failure (#True = #False), so I'm expecting 2 failures (once in no flags, once in UNICODE).
3) I'm expecting some message content from the failing assert and also the UnitDebug statements in the other procedures.
I've tested this on PB 5.62 32- and 64-bit gui and console and also 5.71B1 64-bit on Windows 7 and I'm getting the same output from all.
Are my expectations correct? Does anyone else's results match/differ to mine?
PureUnit isn't particularly verbose even with the /VERBOSE switch - is there anything else I can do to debug this?