Test::Cmd provides a framework for portable, automated testing of executable commands and scripts (in any language, not just Perl), especially those that interact with the file system. In addition to running tests and evaluating conditions, the Test::Cmd module manages and cleans up temporary workspace directories, and provides methods for creating files and directories from in-line data (here-documents).
|Tags||Software Development Testing Libraries Perl Modules|
Release Notes: Test::Cmd::Common module and a wrapper subclass was added to handle common exceptions. Explicit examples of using Test::Cmd with Test::Harness, Test::Unit, and on its own were added to the documentation. Minor fixes to some routines for handling absolute-path end cases were added.
Release Notes: The run() method has been fixed so that it can be used to execute a subsidiary executable or script that's not in the same interpreted language as the script being tested.
Release Notes: Fixes for a bug that only allowed an interpreter to be specified for the run() method if a program was specified, and for a bug that prevented workdir() from returning the absolute path name of a working directory specified as a relative path.
Release Notes: New diff_exact() and diff_regex() methods that return diff(1)-like output when file contents don't match what's expected, and fixes for backwards compatibility with Perl 5.003 and for $TMPDIR specifications that don't match what Cwd::cwd() returns (due to symbolic links or missing WIN32 drive letters).
Release Notes: Separate methods were created to match results against exact text or regular expressions. The match method was changed so that it now calls a registered subroutine, which can be user-supplied or one of the underlying match methods. The default, for backwards compatibility, is the regular expression match.