Test case
test.pbi
Code: Select all
Procedure MyProcedure()
Assert(#False)
EndProcedure
DeclareModule MyModule
Declare MyProcedure()
EndDeclareModule
Module MyModule
Procedure MyProcedure()
Assert(#False)
EndProcedure
EndModule
ProcedureUnit TestMyProcedure()
MyProcedure()
EndProcedureUnit
ProcedureUnit TestMyModuleMyProcedure()
MyModule::MyProcedure() ; Triggers GUI alert
EndProcedureUnit
Code: Select all
"%ProgramFiles%\PureBasic\SDK\PureUnit\PureUnit.exe" /ignore test.pb
Why have Assert() or Fail() inside a module? Typically a TestHelper module to make testing easier. Calling Assert() or Fail() inside a standalone procedure works as expected.
Personally I would prefer if PureUnit.exe was cli only and PureUnitGui.exe was the GUI PureUnit, to avoid any pontential problems when running PureUnit.exe in batch jobs.
Calling PureUnit.exe without any arguments launches the PureUnit GUI, perhaps showing help would be better.