A smaill utility to write unit test for jBASE codes. Right now it provides some basic functions to write a unit test for jBASE codes.
- Write test codes
- Assertions
- Execute all of the tests what are in a folder recursively
It isn't a complete test framework for jBASE yet. It dosen't support like
- Setup and Teardown
- Export test results to different format reports
- More assertions
To use JBUNIT, what you need to do are
- Download JBUNIT source codes to your development environment
- Set up an environment variable JBUNIT_HONME to the value of the path where you store JBUNIT
- Create a folder to contain your test codes
- Create a test as a jBASE program and with the name with prefix of "TEST"
- Execute test through command of
JBUNIT.MAIN /root/path/of/test
- Create a test root folder like: /my_jbase_test
- Create a test as jBASE program like:
PROGRAM TEST.ADD EXPECTED = 3 ACTUAL = 1 + 2 CALL ASSERT.EQUAL(EXPECTED, ACTUAL, "Add calculation failed") STOP
- ASSERT.EQUAL(expected, actual, error_message)
- ASSERT.NOT.EQUAL(exp1, exp2, error_message)
- ASSERT.GREATER(exp1, exp2, error_message)
- ASSERT.LESS(exp1, exp2, error_message)
- ASSERT.TRUE(expression, error_message)
- ASSERT.FALSE(expression, error_message)
The build script of JBUNIT in the folder of build is created based on JBaseBuilder. You may download this utility and configure it with your development environment setup and then build JBUNIT source code. Or you may compile code manually.