1Manifest(3)           User Contributed Perl Documentation          Manifest(3)
2
3
4

NAME

6       Test::Manifest - interact with a t/test_manifest file
7

SYNOPSIS

9               # in Makefile.PL
10               eval "use Test::Manifest";
11
12               # in the file t/test_manifest, list the tests you want
13               # to run
14

DESCRIPTION

16       "Test::Harness" assumes that you want to run all of the .t files in the
17       t/ directory in ascii-betical order during "make test" unless you say
18       otherwise.  This leads to some interesting naming schemes for test
19       files to get them in the desired order. This interesting names ossify
20       when they get into source control, and get even more interesting as
21       more tests show up.
22
23       "Test::Manifest" overrides the default behaviour by replacing the
24       test_via_harness target in the Makefile.  Instead of running at the
25       t/*.t files in ascii-betical order, it looks in the t/test_manifest
26       file to find out which tests you want to run and the order in which you
27       want to run them.  It constructs the right value for MakeMaker to do
28       the right thing.
29
30       In t/test_manifest, simply list the tests that you want to run.  Their
31       order in the file is the order in which they run.  You can comment
32       lines with a "#", just like in Perl, and "Test::Manifest" will strip
33       leading and trailing whitespace from each line.  It also checks that
34       the specified file is actually in the t/ directory.  If the file does
35       not exist, it does not put its name in the list of test files to run
36       and it will issue a warning.
37
38       Optionally, you can add a number after the test name in test_manifest
39       to define sets of tests. See "get_t_files" for more information.
40
41   Functions
42       run_t_manifest( TEST_VERBOSE, INST_LIB, INST_ARCHLIB, TEST_LEVEL )
43           Run all of the files in t/test_manifest through
44           Test::Harness:runtests in the order they appear in the file.
45
46                   eval "use Test::Manifest";
47
48       get_t_files( [LEVEL] )
49           In scalar context it returns a single string that you can use
50           directly in WriteMakefile(). In list context it returns a list of
51           the files it found in t/test_manifest.
52
53           If a t/test_manifest file does not exist, get_t_files() returns
54           nothing.
55
56           get_t_files() warns you if it can't find t/test_manifest, or if
57           entries start with "t/". It skips blank lines, and strips Perl
58           style comments from the file.
59
60           Each line in t/test_manifest can have three parts: the test name,
61           the test level (a floating point number), and a comment. By
62           default, the test level is 1.
63
64                   test_name.t 2  #Run this only for level 2 testing
65
66           Without an argument, get_t_files() returns all the test files it
67           finds. With an argument that is true (so you can't use 0 as a
68           level) and is a number, it skips tests with a level greater than
69           that argument. You can then define sets of tests and choose a set
70           to run. For instance, you might create a set for end users, but
71           also add on a set for deeper testing for developers.
72
73           Experimentally, you can include a command to grab test names from
74           another file. The command starts with a ";" to distinguish it from
75           a true filename. The filename (currently) is relative to the
76           current working directory, unlike the filenames, which are relative
77           to "t/". The filenames in the included are still relative to "t/".
78
79                   ;include t/file_with_other_test_names.txt
80
81           Also experimentally, you can stop Test::Manifest from reading
82           filenames with the ";skip" directive. Test::Harness will skip the
83           filenames up to the ";unskip" directive (or end of file)
84
85                   run_this1
86                   ;skip
87                   skip_this
88                   ;unskip
89                   run_this2
90
91           To select sets of tests, specify the level in the variable
92           TEST_LEVEL during `make test`.
93
94                   make test # run all tests no matter the level
95                   make test TEST_LEVEL=2  # run all tests level 2 and below
96
97       make_test_manifest()
98           Creates the test_manifest file in the t directory by reading the
99           contents of the t directory.
100
101           TO DO: specify tests in argument lists.
102
103           TO DO: specify files to skip.
104
105       manifest_name()
106           Returns the name of the test manifest file, relative to t/
107

SOURCE AVAILABILITY

109       This source is in Github:
110
111               http://github.com/briandfoy/Test-Manifest/tree/master
112

CREDITS

114       Matt Vanderpol suggested and supplied a patch for the ;include feature.
115

AUTHOR

117       brian d foy, "<bdfoy@cpan.org>"
118
120       Copyright (c) 2002-2009 brian d foy.  All rights reserved.
121
122       This program is free software; you can redistribute it and/or modify it
123       under the same terms as Perl itself.
124
125
126
127perl v5.16.3                      2009-07-17                       Manifest(3)
Impressum