1Test::Run::Core(3)    User Contributed Perl Documentation   Test::Run::Core(3)
2
3
4

NAME

6       Test::Run::Core - Base class to run standard TAP scripts.
7

VERSION

9       Version 0.0305
10
11   BUILD
12       For Moose.
13
14   $self->helpers_base_namespace()
15       See Test::Run::Base::PlugHelpers.
16
17   Object Parameters
18       These parameters are accessors. They can be set at object creation by
19       passing their name along with a value on the constructor (along with
20       the compulsory 'test_files' argument):
21
22           my $tester = Test::Run::Obj->new(
23               {
24                   'test_files' => \@mytests,
25                   'Verbose' => 1,
26               }
27           );
28
29       Alternatively, before "runtests()" is called, they can be set by
30       passing a value to their accessor:
31
32           $tester->Verbose(1);
33
34       "$self->Verbose()"
35           The object variable "$self->Verbose()" can be used to let
36           "runtests()" display the standard output of the script without
37           altering the behavior otherwise.  The runprove utility's "-v" flag
38           will set this.
39
40       "$self->Leaked_Dir()"
41           When set to the name of a directory, $tester will check after each
42           test whether new files appeared in that directory, and report them
43           as
44
45             LEAKED FILES: scr.tmp 0 my.db
46
47           If relative, directory name is with respect to the current
48           directory at the moment "$tester->runtests()" was called.  Putting
49           the absolute path into "Leaked_Dir" will give more predictable
50           results.
51
52       "$self->Debug()"
53           If "$self->Debug()" is true, Test::Run will print debugging
54           information about itself as it runs the tests.  This is different
55           from "$self->Verbose()", which prints the output from the test
56           being run.
57
58       "$self->Columns()"
59           This value will be used for the width of the terminal. If it is not
60           set then it will default to 80.
61
62       "$self->Timer()"
63           If set to true, and "Time::HiRes" is available, print elapsed
64           seconds after each test file.
65
66       "$self->NoTty()"
67           When set to a true value, forces it to behave as though STDOUT were
68           not a console.  You may need to set this if you don't want harness
69           to output more frequent progress messages using carriage returns.
70           Some consoles may not handle carriage returns properly (which
71           results in a somewhat messy output).
72
73       "$self->Test_Interprter()"
74           Usually your tests will be run by $^X, the currently-executing
75           Perl.  However, you may want to have it run by a different
76           executable, such as a threading perl, or a different version.
77
78       "$self->Switches()" and "$self->Switches_Env()"
79           These two values will be prepended to the switches used to invoke
80           perl on each test.  For example, setting one of them to "-W" will
81           run all tests with all warnings enabled.
82
83           The difference between them is that "Switches_Env()" is expected to
84           be filled in by the environment and "Switches()" from other sources
85           (like the programmer).
86
87   METHODS
88       Test::Run currently has only one interface method.
89
90   $tester->runtests()
91           my $all_ok = $tester->runtests()
92
93       Runs the tests, see if they are OK. Returns true if they are OK, or
94       throw an exception otherwise.
95
96   $self->_report_leaked_files({leaked_files => [@files]})
97       [This is a method that needs to be over-rided.]
98
99       Should report (or ignore) the files that were leaked in the directories
100       that were specifies as leaking directories.
101
102   $self->_report_failed_with_results_seen({%args})
103       [This is a method that needs to be over-rided.]
104
105       Should report (or ignore) the failed tests in the test file.
106
107       Arguments are:
108
109       •   test_struct
110
111           The test struct as returned by straps.
112
113       •   filename
114
115           The filename
116
117       •   estatus
118
119           Exit status.
120
121       •   wstatus
122
123           Wait status.
124
125       •   results
126
127           The results of the test.
128
129   $self->_recheck_dir_files()
130       Called to recheck that the dir files is OK.
131
132
133
134perl v5.32.1                      2021-01-27                Test::Run::Core(3)
Impressum