shell script that can be source
d to have produce TAP output for test files
- create
tests/setup.sh
- create test files, ex
tests/example.test.sh
- run tests, and on success call
ok <test name>
orfail <test name>
(orskip <test-name>
)
do need to ensure that none of the tests output TAP related output (ex redirecting stdout
)
Can now use prove
to run tests: prove --directives tests/*test.sh
:
tests/runs-commands.test.sh ..
not ok 4 d # TODO: skipped
not ok 5 e # TODO: not yet implemented
ok
All tests successful.
Files=1, Tests=5, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.01 cusr 0.00 csys = 0.03 CPU)
Result: PASS
scripts can still be run directly to show the raw