Installation

  • Download a source code archive, using the Downloads link on the left.
  • Extract it, using an application like WinZip or gzip.
  • Create the physical source files on your iSeries host. From there on, YOURLIB should be replaced by the name of the library where you want to install RPGUnit.
    ===> CRTSRCPF FILE(YOURLIB/RPGUNIT1) RCDLEN(112) TEXT('RPGUnit - Framework.')
    ===> CRTSRCPF FILE(YOURLIB/RPGUNITC1) RCDLEN(112) TEXT('RPGUnit - Commands.')
    ===> CRTSRCPF FILE(YOURLIB/RPGUNITF1) RCDLEN(112) TEXT('RPGUnit - Test Fixtures.')
    ===> CRTSRCPF FILE(YOURLIB/RPGUNITT1) RCDLEN(112) TEXT('RPGUnit - Self-Test.')
    ===> CRTSRCPF FILE(YOURLIB/RPGUNITY1) RCDLEN(112) TEXT('RPGUnit - Prototypes.')
  • Upload the source code to your iSeries host.
    > cd THE/PATH/WHERE/YOU/EXTRACTED/THE/SOURCE/CODE/ARCHIVE
    > ftp your.iSeries.host
    ftp> ascii
    ftp> prompt
    ftp> cd /QSYS.LIB/YOURLIB.LIB
    ftp> mput *.FILE/*.MBR
    ftp> bye
  • Restore the source member meta-data.
    ===> CRTBNDCL PGM(QTEMP/MKMETADATA) SRCFILE(YOURLIB/RPGUNIT1)
    ===> CALL PGM(QTEMP/MKMETADATA) PARM(YOURLIB)
  • Compile the framework.
    ===> CRTBNDCL PGM(YOURLIB/MKRPGUNIT) SRCFILE(YOURLIB/RPGUNIT1)
    ===> SBMJOB CMD(CALL PGM(YOURLIB/MKRPGUNIT) PARM(YOURLIB)) JOB(MKRPGUNIT)
  • Start writing unit tests!
  • If you want, you can check the framework by running its own regression test harness.
    • Compile the test harness.
      ===> CRTBNDCL PGM(YOURLIB/MKRPGUNITT) SRCFILE(YOURLIB/RPGUNITT1)
    • Run the test harness.
      ===> SBMJOB CMD(CALL PGM(YOURLIB/MKRPGUNITT) PARM(QTEMP)) JOB(MKRPGUNITT)
    • If the MKRPGUNITT job ends normally (without any error), it means the framework is sound and working.