## cmdtest

https://liw.fi/cmdtest/

Black box tests Unix command line tools. Roughly, it is given a a script, its input files, and its expected output files. cmdtest runs the script, and checks the output is as expected.

 1  apt show cmdtest
Package: cmdtest
Version: 0.22-1
Priority: optional
Section: universe/python
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Lars Wirzenius <liw@liw.fi>
Installed-Size: 78.8 kB
Depends: python (>= 2.7), python (<< 2.8), python-cliapp, python-ttystatus, python-markdown
Homepage: http://liw.fi/cmdtest/
APT-Manual-Installed: yes
APT-Sources: http://nz.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
Description: blackbox testing of Unix command line programs
cmdtest black box tests Unix command line tools. Roughly, it is given a a
script, its input files, and its expected output files. cmdtest runs the
script, and checks the output is as expected.
.
cmdtest is aimed specifically at testing non-interactive Unix command line
programs, and tries to make that as easy as possible.
.
Also included is a "scenario testing" tool, yarn.

 1  agi cmdtest
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42  NAME yarn - scenario testing of Unix command line tools SYNOPSIS yarn [--allow-missing-steps] [--no-allow-missing-steps] [--cd-datadir] [--no-cd-datadir] [--config=FILE] [--dump-config] [--dump-setting-names] [--generate-manpage=TEMPLATE] [-h] [--help] [--help-all] [--list-config-files] [--version] [--no-default-configs] [--dump-memory-profile=METHOD] [--env=NAME=VALUE] [--log=FILE] [--log-keep=N] [--log-level=LEVEL] [--log-max=SIZE] [--log-mode=MODE] [--memory-dump-interval=SECONDS] [--output=FILE] [-q] [--quiet] [--no-quiet] [--require-assumptions] [--no-require-assumptions] [-rSCENARIO] [--run=SCENARIO] [--shell=SHELL] [--shell-arg=ARG] [-sSHELL-LIBRARY] [--shell-library=SHELL-LIBRARY] [--snapshot] [--no-snapshot] [--tempdir=DIR] [--timings] [--no-timings] [-v] [--verbose] [--no-verbose] [-n] [--no-act] [--dry-run] [--pretend] [--no-no-act] [--no-dry-run] [--no-pretend] [FILE]... DESCRIPTION yarn is a scenario testing tool: you write a scenario de‐ scribing how a user uses your software and what should hap‐ pen, and express, using very lightweight syntax, the scenario in such a way that it can be tested automatically. The sce‐ nario has a simple, but strict structure: GIVEN some setup for the test WHEN thing that is to be tested happens THEN the post-conditions must be true As an example, consider a very short test scenario for veri‐ fying that a backup program works, at least for one simple case. SCENARIO backups can be restored GIVEN some live data in a directory AND an empty backup repository WHEN a backup is made THEN the data case be restored FINALLY cleanup