Test::Run::Core - Base class to run standard TAP scripts.
These parameters are accessors. They can be set at object creation by passing their name along with a value on the constructor (along with the compulsory 'test_files' argument):
my $tester = Test::Run::Obj->new(
'test_files' => \@mytests,
'Verbose' => 1,
Alternatively, before runtests() is called, they can be set by passing a value to their accessor:
The object variable $self->Verbose() can be used to let runtests() display the standard output of the script without altering the behavior otherwise. The runprove utility's -v flag will set this.
When set to the name of a directory, $tester will check after each test whether new files appeared in that directory, and report them as
LEAKED FILES: scr.tmp 0 my.db
If relative, directory name is with respect to the current directory at the moment $tester->runtests() was called. Putting the absolute path into Leaked_Dir will give more predictable results.
If $self->Debug() is true, Test::Run will print debugging information about itself as it runs the tests. This is different from $self->Verbose(), which prints the output from the test being run.
This value will be used for the width of the terminal. If it is not set then it will default to 80.
If set to true, and Time::HiRes is available, print elapsed seconds after each test file.
When set to a true value, forces it to behave as though STDOUT were not a console. You may need to set this if you don't want harness to output more frequent progress messages using carriage returns. Some consoles may not handle carriage returns properly (which results in a somewhat messy output).
Usually your tests will be run by $^X, the currently-executing Perl. However, you may want to have it run by a different executable, such as a threading perl, or a different version.
These two values will be prepended to the switches used to invoke perl on each test. For example, setting one of them to -W will run all tests with all warnings enabled.
The difference between them is that Switches_Env() is expected to be filled in by the environment and Switches() from other sources (like the programmer).
Test::Run currently has only one interface method.
my $all_ok = $tester->runtests()
Runs the tests, see if they are OK. Returns true if they are OK, or throw an exception otherwise.
[This is a method that needs to be over-rided.]
Should report (or ignore) the files that were leaked in the directories that were specifies as leaking directories.
Should report (or ignore) the failed tests in the test file.
The test struct as returned by straps.
The results of the test.
Called to recheck that the dir files is OK.
To install Test::Run, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.