Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.547.548 Times

Test::Cmd 1.05

  Date Added: November 19, 2010  |  Visits: 572

Test::Cmd

Report Broken Link
Printer Friendly Version


Product Homepage
Download (92 downloads)



Test::Cmd is a Perl module for portable testing of commands and scripts. SYNOPSIS use Test::Cmd; $test = Test::Cmd->new(prog => program_or_script_to_test, interpreter => script_interpreter, string => identifier_string, workdir => , subdir => dir, match_sub => $code_ref, verbose => 1); $test->verbose(1); $test->prog(program_or_script_to_test); $test->basename(@suffixlist); $test->interpreter(script_interpreter); $test->string(identifier string); $test->workdir(prefix); $test->workpath(subdir, file); $test->subdir(subdir, ...); $test->subdir([sub, dir], ...); $test->write(file, <<EOF); contents of file EOF $test->write([subdir, file], <<EOF); contents of file EOF $test->read($contents, file); $test->read(@lines, file); $test->read($contents, [subdir, file]); $test->read(@lines, [subdir, file]); $test->writable(dir); $test->writable(dir, $rwflag); $test->writable(dir, $rwflag, %errors); $test->preserve(condition, ...); $test->cleanup(condition); $test->run(prog => program_or_script_to_test, interpreter => script_interpreter, chdir => dir, args => arguments, stdin => <<EOF); input to program EOF $test->pass(condition); $test->pass(condition, &func); $test->fail(condition); $test->fail(condition, &func); $test->fail(condition, &func, $caller); $test->no_result(condition); $test->no_result(condition, &func); $test->no_result(condition, &func, $caller); $test->stdout; $test->stdout($run_number); $test->stderr; $test->stderr($run_number); $test->match(@lines, @matches); $test->match($lines, $matches); $test->match_exact(@lines, @matches); $test->match_exact($lines, $matches); $test->match_regex(@lines, @regexes); $test->match_regex($lines, $regexes); $test->diff_exact(@lines, @matches, @output); $test->diff_exact($lines, $matches, @output); $test->diff_regex(@lines, @regexes, @output); $test->diff_regex($lines, $regexes, @output); sub func { my ($self, $lines, $matches) = @_; # code to match $lines and $matches } $test->match_sub(&func); $test->match_sub(sub { code to match $_[1] and $_[2] }); $test->here; The Test::Cmd module provides a low-level framework for portable automated testing of executable commands and scripts (in any language, not just Perl), especially commands and scripts that interact with the file system. The Test::Cmd module makes no assumptions about what constitutes a successful or failed test. Attempting to read a file that doesnt exist, for example, may or may not be an error, depending on the software being tested. Consequently, no Test::Cmd methods (including the new() method) exit, die or throw any other sorts of exceptions (but they all do return useful error indications). Exceptions or other error status should be handled by a higher layer: a subclass of Test::Cmd, or another testing framework such as the Test or Test::Simple Perl modules, or by the test itself. (That said, see the Test::Cmd::Common module if you want a similar module that provides exception handling, either to use directly in your own tests, or as an example of how to use Test::Cmd.) 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. When used in conjunction with another testing framework, the Test::Cmd module can function as a fixture (common startup code for multiple tests) for simple management of command execution and temporary workspaces. 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. A Test::Cmd environment object is created via the usual invocation: $test = Test::Cmd->new(); Arguments to the Test::Cmd::new method are keyword-value pairs that may be used to initialize the object, typically by invoking the same-named method as the keyword.. Cons - A Make Replacement.

Requirements: No special requirements
Platforms: Linux
Keyword: Condition File Libraries Lines Match Matches Module Perl Module Programming Testcmd
Users rating: 0/10

License: Freeware Size: 30.72 KB
USER REVIEWS
More Reviews or Write Review


TEST::CMD RELATED
Libraries  -  File::Find::Rule::XPath 0.03
File::Find::Rule::XPath is a Perl module that contains rule to match on XPath expressions. SYNOPSIS use File::Find::Rule::XPath; my @files = File::Find::Rule->file ->name(*.dkb) ->xpath( //section/title[contains(., "Crustacean")] )...
4.1 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  File::LckPwdF 0.01
File::LckPwdF is a Perl module to lock and unlock the passwd and shadow files with lckpwdf and ulckpwdf. SYNOPSIS use File::LckPwdF; (lock_passwd(15)) || (die "Cant lock password file:n$! stopped"); # ... do stuff with the passwd file ......
5.12 KB  
Libraries  -  File::Maker 0.05
File::Maker is a Perl module that mimics a make by loading a database and calling targets methods. SYNOPSIS ##### # Subroutine interface # use File::Maker qw(load_db); %data = load_db($pm); ###### # Object interface # require...
77.82 KB  
Libraries  -  File::Where 0.05
File::Where is a Perl module to find the absolute file for a program module; absolute dir for a repository. SYNOPSIS ####### # Subroutine interface # use File::Where qw(pm2require where where_dir where_file where_pm where_repository);...
83.97 KB  
Libraries  -  Syntax::Highlight::Perl 1.0
Syntax::Highlight::Perl is a Perl module that can highlight Perl Syntactical Structures. SYNOPSIS # simple procedural use Syntax::Highlight::Perl :BASIC; # or :FULL print format_string($my_string); # OO use Syntax::Highlight::Perl; my...
33.79 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Libraries  -  Apache::TestRun 1.28
Apache::TestRun is a Perl module to run the test suite. SYNOPSIS The Apache::TestRun package controls the configuration and running of the test suite. METHODS Several methods are sub-classable, if the default behavior should be changed....
143.36 KB  
Libraries  -  Lemonldap::Config::Parameters 3.1.1
emonldap::Config::Parameters is a Perl module as a Backend of configuration for lemonldap SSO system. SYNOPSIS #!/usr/bin/perl use Lemonldap::Config::Parameters; use Data::Dumper; my $nconfig= Lemonldap::Config::Parameters->new( file...
12.29 KB  
Libraries  -  Net::LDAP::FAQ 0.34
Net::LDAP::FAQ is a Perl module with Frequently Asked Questions about Net::LDAP. SYNOPSIS perldoc Net::LDAP::FAQ This document serves to answer the most frequently asked questions on both the perl-ldap Mailing List and those sent to Graham...
256 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB