1Manifest(3) User Contributed Perl Documentation Manifest(3)
2
3
4
6 Test::Manifest - interact with a t/test_manifest file
7
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
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
37 Optionally, you can add a number after the test name in test_manifest
38 to define sets of tests. See get_t_files() for more information.
39
40 Functions
41 run_t_manifest( TEST_VERBOSE, INST_LIB, INST_ARCHLIB, TEST_LEVEL )
42 Run all of the files in t/test_manifest through
43 Test::Harness:runtests in the order they appear in the file.
44
45 eval "use Test::Manifest";
46
47 get_t_files( [LEVEL] )
48 In scalar context it returns a single string that you can use
49 directly in WriteMakefile(). In list context it returns a list of
50 the files it found in t/test_manifest.
51
52 If a t/test_manifest file does not exist, get_t_files() returns
53 nothing.
54
55 get_t_files() warns you if it can't find t/test_manifest, or if
56 entries start with "t/". It skips blank lines, and strips Perl
57 style comments from the file.
58
59 Each line in t/test_manifest can have three parts: the test name,
60 the test level (a floating point number), and a comment. By
61 default, the test level is 1.
62
63 test_name.t 2 #Run this only for level 2 testing
64
65 Without an argument, get_t_files() returns all the test files it
66 finds. With an argument that is true (so you can't use 0 as a
67 level) and is a number, it skips tests with a level greater than
68 that argument. You can then define sets of tests and choose a set
69 to run. For instance, you might create a set for end users, but
70 also add on a set for deeper testing for developers.
71
72 Experimentally, you can include a command to grab test names from
73 another file. The command starts with a ";" to distinguish it from
74 a true filename. The filename (currently) is relative to the
75 current working directory, unlike the filenames, which are relative
76 to "t/". The filenames in the included are still relative to "t/".
77
78 ;include t/file_with_other_test_names.txt
79
80 Also experimentally, you can stop Test::Manifest from reading
81 filenames with the ";skip" directive. Test::Harness will skip the
82 filenames up to the ";unskip" directive (or end of file)
83
84 run_this1
85 ;skip
86 skip_this
87 ;unskip
88 run_this2
89
90 To select sets of tests, specify the level in the variable
91 TEST_LEVEL during `make test`.
92
93 make test # run all tests no matter the level
94 make test TEST_LEVEL=2 # run all tests level 2 and below
95
96 make_test_manifest()
97 Creates the test_manifest file in the t directory by reading the
98 contents of the t directory.
99
100 TO DO: specify tests in argument lists.
101
102 TO DO: specify files to skip.
103
104 manifest_name()
105 Returns the name of the test manifest file, relative to t/
106
108 This source is part of a SourceForge project which always has the
109 latest sources in CVS, as well as all of the previous releases.
110
111 http://sourceforge.net/projects/brian-d-foy/
112
113 If, for some reason, I disappear from the world, one of the other
114 members of the project can shepherd this module appropriately.
115
117 Matt Vanderpol suggested and supplied a patch for the ;include feature.
118
120 brian d foy, "<bdfoy@cpan.org>"
121
123 Copyright (c) 2002-2007 brian d foy. All rights reserved.
124
125 This program is free software; you can redistribute it and/or modify it
126 under the same terms as Perl itself.
127
128
129
130perl v5.10.1 2007-10-28 Manifest(3)