Commit 6f54122b authored by Tilman Kranz's avatar Tilman Kranz

add documentation of test procedures

parent ed903677
# Testing
## Running all Tests
## Running noninteractive Tests only
./utils/ --noninteractive
## Running Test of an individual Script
./utils/ 01-basics/
## Internals
By default, every executable in a numbered subdirectory that has a name
ending with `.sh` or `.bash` is tested.
Testing an executable means
1. Running it through [](Shellcheck), and then
2. executing it.
Before executing the script, the [utils/](Test Utility) scans the
file for special comments containing `@Test [ARGUMENT ...]`, `@TestRv INT`
and `@TestInteractive true|false`, that, if present, indicate if and how the
test should be run.
Arguments for the test execution can be provided by including a line as
follows somewhere in the script:
# @Test --foo --bar
Testing is marked as "interactive", meaning, it requires user interaction,
if the script contains the following line:
# @TestInteractive true
Running the script should return exit code 0 by default for the test to
succeed. If a different value is expected, it can be provided using the
`@TestRv` comment. For example, to indicate that a script, when tested,
should return an exit code 1:
# @TestRv 1
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment