Status: Sitesh is implementing this at fifthtry/fbt.
For some projects, especially ones that work with files etc, the best way to document and to test them is via a bunch of folders containing input and output folders after a command is executed.
example, it sub-folders like
01_basic. Each such sub folder
can be considered a “test case”.
In the test case folder, eg
we have two folders,
output, and a file
fifthtry/fbt, goes through each test case, and
runs the command listed in
cmd.txt file, with current directory
input. It then verifies that
input has become identical
output, if so test is considered passed, else its considered
When running the command listed in
cmd.toml, it also ensures
that command exited with proper status code. This is how
cmd.toml looks like:
cmd = "cat one1" code = 1 stdout = '' stderr = 'cat: one1: No such file or directory'
[stderr] are optional. If
[code] is missing exit code is assumed to be zero. If either
[stderr] are missing, the
stderr of the command are ignored, else they must be exactly
equal to what is specified in these keys.
output folder is optional. If the folder is missing, the command
is still run inside
input folder, but test is considered passed
or failed only depending on exit code.