diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-09-11 19:17:41 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-09-11 19:17:41 +0100 |
commit | 33be3b31e9cbbb138911371480e213f6478c1bf3 (patch) | |
tree | 97f670031cba60a135d6fbecb6eb87d7aa2b996e /cmdtest.1.in | |
parent | f3e390374d5bff22b30f26dc22bc3b29c872402f (diff) | |
download | cmdtest-33be3b31e9cbbb138911371480e213f6478c1bf3.tar.gz |
Add preliminary manpage for cmdtest.
Diffstat (limited to 'cmdtest.1.in')
-rw-r--r-- | cmdtest.1.in | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/cmdtest.1.in b/cmdtest.1.in new file mode 100644 index 0000000..f9aea7b --- /dev/null +++ b/cmdtest.1.in @@ -0,0 +1,78 @@ +.\" Copyright 2011 Lars Wirzenius <liw@liw.fi> +.\" +.\" This program is free software: you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation, either version 3 of the License, or +.\" (at your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program. If not, see <http://www.gnu.org/licenses/>. +.\" +.TH CMDTEST 1 +.SH NAME +cmdtest \- blackbox testing of Unix command line tools +.SH SYNOPSIS +.SH DESCRIPTION +.B cmdtest +tests Unix command line tools, +preferably non-interactive ones. +The user writes some tests, +consisting of the command to run, the input files given to it, +and the expected output. +.B cmdtest +runs the command, +compares the actual output to the expected output, +and reports any differences. +If everything matches, +then tests pass. +.SH OPTIONS +.SH EXAMPLE +To test that the +.BR echo (1) +command outputs the expected string, +create a file called +.I echo-tests/hello.script +containing the following content: +.IP +.nf +#!/bin/sh +echo hello, world +.fi +.PP +Also create the file +.I echo-tests/hello.stdout +containing: +.IP +hello, world +.PP +Then you can run the tests: +.IP +.nf +$ cmdtest echo-tests +test 1/1 +1/1 tests OK, 0 failures +.fi +.PP +If you change the stdout file to be something else, +.B cmdtest +will report the differences: +.IP +.nf +$ cmdtest echo-tests +FAIL: hello: stdout diff: +--- echo-tests/hello.stdout 2011-09-11 19:14:47 +0100 ++++ echo-tests/hello.stdout-actual 2011-09-11 19:14:49 +0100 +@@ -1 +1 @@ +-something else ++hello, world + +test 1/1 +0/1 tests OK, 1 failures +.fi +.SH "SEE ALSO" +.BR cliapp (5). |