Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neilb/test-cmd
Perl 5 module for portable testing of commands and scripts
https://github.com/neilb/test-cmd
Last synced: about 2 months ago
JSON representation
Perl 5 module for portable testing of commands and scripts
- Host: GitHub
- URL: https://github.com/neilb/test-cmd
- Owner: neilb
- Created: 2014-04-02T18:20:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-05-30T08:34:12.000Z (over 1 year ago)
- Last Synced: 2024-10-11T21:08:44.179Z (2 months ago)
- Language: Perl
- Homepage: https://metacpan.org/pod/Test::Cmd
- Size: 116 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README
- Changelog: Changes
Awesome Lists containing this project
README
THE Test::Cmd MODULE
The Test::Cmd module provides a framework for portable automated testing
of executable commands and scripts (in any language, not just Perl),
especially commands and scripts that interace with the file system.In addition to running tests and evaluating conditions, the Test::Cmd
module manages and cleans up one or more temporary workspace directories,
and provides methods for creating files and directories in those workspace
directories from in-line data (that is, here-documents), allowing tests
to be completely self-contained.The Test::Cmd module inherits File::Spec methods (file_name_is_absolute(),
catfile(), etc.) to support writing tests portably across a variety of
operating and file systems.The Test::Cmd module may be used with the Test module to report test
results for use with the Test::Harness module. Alternatively, the
Test::Cmd module provides pass(), fail(), and no_result() methods that
report test results for use with the Aegis change management system.
It is not a good idea to intermix these two reporting models.INSTALLATION
Installation is via the usual incantation:
# perl Makefile.PL
# make
# make test
# make installLet me know if you have any problems.
RESOURCES
A rudimentary page for the Test::Cmd module is available at:
http://www.baldmt.com/Test-Cmd/
The most involved example of using the Test::Cmd package to test
a real-world application is the "cons-test" testing suite for the
Cons software construction utility. The suite sub-classes Test::Cmd
to provide common, application-specific infrastructure across a
large number of end-to-end application tests. The suite, and other
information about Cons, is available at:http://www.dsmit.com/cons
TO DO
The t/run.t test jumps through some complicated (but reasonably
documented) hoops to generate an executable Perl script on Windows
NT systems. I have no doubt that someone with a better knowledge of NT
than mine could do this more simply, and would love to hear of a better
solution than what I came up with.Adding a timeout() method would provide better test automation for
applications that run the risk of hanging.A feature to time tests would be good.
COPYRIGHT
Copyright 1999-2001 Steven Knight. All rights reserved. This program
is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.ACKNOWLEDGEMENTS
Thanks to Greg Spencer for the inspiration to create this package and
the initial draft of its implementation as a specific testing package
for the Cons software construction utility. Information about Cons
is available at:http://www.dsmit.com/cons/
The general idea of managing temporary working directories in this way,
as well as the test reporting of the pass(), fail() and no_result()
methods, come from the testing framework invented by Peter Miller for
his Aegis project change supervisor. Aegis is an excellent bit of work
which integrates creation and execution of regression tests into the
software development process. Information about Aegis is available at:http://aegis.sourceforge.net/
AUTHOR
Steven Knight, [email protected]