GithubHelp home page GithubHelp logo

i-unit / iunit Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 2.0 39 KB

IBM i Unit Testing Framework

Home Page: https://remainsoftware.com

Batchfile 66.16% Shell 33.84%
ibmi ibmioss unittest unittesting unittesting-library remainsoftware

iunit's Introduction

IUNIT IBM i Unit Testing Framework

Welcome to IUNIT. The lightweight extensible unit testing framework for IBM i.
Check prerequisites.

Building in library IUNIT (install and use bash)

git clone https://github.com/i-unit/iunit.git
cd iunit
source build.sh
iunit.restore IUNIT

Test

addlible iunit
runone iunit pass
runall iunit

Using

  • Create a test suite library 'mytest'
  • Create a CLLE program named 'pass' with this program source.
  • addlible iunit
  • crtdupobj utemsg iunit *msgf mytst
  • addlible mytest
  • runall mytest

Create a CLLE program named 'fail' with this program source.
runall mytest

Workings

RUNALL runs all programs in the library that do not start with I_
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
I_SETUP is called before RUNONE and RUNALL run any tests
I_TEARDOWN is called after RUNONE and RUNALL have ran all tests

Best practices

Do not depend one test on the result of another test
A library is set of related tests (a test suite). 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

Tips

Copy I_SETUP and I_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

Contribute

Did you add functions to IUNIT (like logging)?. Consider contributing back by creating a pull request.

License

MIT Copyright 2019 Remain BV

iunit's People

Contributors

wimjongman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

iunit's Issues

@ sign not working for some character sets

IUNIT is using @ as start of an object name to identify that this specific program is not a test. This will not work on certain CCSID's.

Please replace the special character @ for I_.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.