Specsheet

Output formats

Specsheet emits output to show the progress made through the checks as they get executed. The format it outputs in is configurable, depending on what is needed.

Console (human-readable)

The default output type is intended for running Specsheet on the command-line.

$ specsheet checks.toml
 apt package 'cmatrix' is installed
1 test passed, 0 tests failed

If Specsheet is being run in a terminal, the output will be coloured by ANSI escape codes; if it’s being run in a pipeline or not to a terminal, it will not. To change this behaviour, use the --colour or --color command-line option.

Dots

The dots output is very minimal — it just prints one dot “.“ character for each check that passes, and one “X“ character for each check that fails. At the end, a description of each check that failed is displayed.

$ specsheet spec.toml --format dots
...X

This output format is most useful when there are many tests to be run, with few estimated to fail.

JSON Lines

The JSON Lines output prints a JSON object for each check result as it happens. This is intended to be passed into an automated script.

If you want to format the JSON objects, pipe them through jq.

If you’d like the results as one large JSON document, rather than multiple ones on each line, use the JSON report format.

TAP

The Test Anything Protocol is a generic way to describe test output.

A description of each test is added to the end of each line, and the name of each file is printed as a diagnostic line. Here’s what it looks like:

$ specsheet spec.toml --format tap
# running spec.toml
ok 1 - Input file opened
ok 2 - First line of the input valid
ok 3 - Read the rest of the file
not ok 4 - Summarized correctly # TODO Not written yet

You can then pipe the output from Specsheet into anything that consumes TAP.