IUNIT IBM i Unit Testing Framework
Welcome to IUNIT. The lightweight extensible unit testing framework for IBM i.
git clone https://github.com/i-unit/iunit.git
runone iunit pass
Create a library 'mytest'
Create a CLLE program named 'pass' with this program source.
addlible iunit *last
ADDLIBLE LIB(MYTEST) POSITION(*BEFORE IUNIT)
Create a CLLE program named 'fail' with this program source.
RUNALL runs all programs in the library that do not start with @
Fail your test program by sending an escape message to *PRV with sndpgmmsg
Make sure the tests do not hang in QSYSOPR message queue by monitoring all commands. Otherwise they will stall your test
@SETUP is called before RUNONE and RUNALL run any tests
@TEARDOWN is called after RUNONE and RUNALL have ran all tests
Do not depend one test on the result of another test
A library is set of related tests. Create as many libraries as you need and call them sequentially
When using TD/OMS as your change management system. include tests in your compile or transfer
Copy @SETUP and @TEARDOWN source from IUNIT into your test libraries and modify
You can copy IUNIT into your test library so that it is completely self contained
Did you add functions to IUNIT (like logging)?. Consider contributing back by creating a pull request.