SYNOPSYS import "clive/cmd/test" func Cmd(t *testing.T, cmd string) (cout, cerr string, fails bool) func Cmds(t *testing.T, runs []Run) func InstallCmd(t *testing.T) type Run struct { ... } DESCRIPTION Help for testing commands CONSTANTS TYPES type Run struct { Line string Out, Err string Fails bool Ok bool // if set, out, err and fails are ignored } FUNCTIONS func Cmd(t *testing.T, cmd string) (cout, cerr string, fails bool) Run cmd and make sure that the out and err streams are as given. The command runs at /tmp/cmdtest where zx/fstest.MkTree has created our usual file testing tree, in case the command needs input. It is run using "sh -c 'cd /tmp/cmdtest;' ". go install is run before running the command. func Cmds(t *testing.T, runs []Run) func InstallCmd(t *testing.T) Installs the command, for use before running the tests.
Clive, 2nd ed. User's manual. Section 2