Skip to content
Felipe Contreras edited this page Mar 15, 2023 · 2 revisions

Sharness is a test harness written in shell.

Because Sharness is written in shell, commands like git init are easy to execute, and therefore unlike other test frameworks, Sharness is great to test command line interfaces.

Every test script is a standalone script that can be run on it's own (e.g. ./test.t), therefore the harness can be easily integrated with build systems like make.

Moreover, because the tests scripts follow the Test Anything Protocol, they can be run with prove—or any other TAP consumer—which can run the tests in parallel, and produce nice summaries.

Alternatively, test results are stored in a test-results directory which can be parsed with the provided aggregate-results.sh script, that can be run at the end of every make run.

If the tests fail, the test-results remain available, along with the trash directories, which is where the output of tests are temporarily stored.

Every test is launched inside their corresponding trash directory, and that is set to $HOME, so the user's home is not affected.

Clone this wiki locally