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 lead‐
33 ing and trailing whitespace from each line. It also checks that the
34 specified file is actually in the t/ directory. If the file does not
35 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
42 run_t_manifest( TEST_VERBOSE, INST_LIB, INST_ARCHLIB, TEST_LEVEL )
43 Run all of the files in t/test_manifest through Test::Har‐
44 ness: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 cur‐
76 rent working directory, unlike the filenames, which are relative to
77 "t/". The filenames in the included are still relative to "t/".
78
79 ;include t/file_with_other_test_names.txt
80
81 To select sets of tests, specify the level in the variable
82 TEST_LEVEL during `make test`.
83
84 make test # run all tests no matter the level
85 make test TEST_LEVEL=2 # run all tests level 2 and below
86
87 make_test_manifest()
88 Creates the test_manifest file in the t directory by reading the
89 contents of the t directory.
90
91 TO DO: specify tests in argument lists.
92
93 TO DO: specify files to skip.
94
95 manifest_name()
96 Returns the name of the test manifest file, relative to t/
97
99 This source is part of a SourceForge project which always has the lat‐
100 est sources in CVS, as well as all of the previous releases.
101
102 http://sourceforge.net/projects/brian-d-foy/
103
104 If, for some reason, I disappear from the world, one of the other mem‐
105 bers of the project can shepherd this module appropriately.
106
108 Matt Vanderpol suggested and supplied a patch for the ;include feature.
109
111 brian d foy, "<bdfoy@cpan.org>"
112
114 Copyright (c) 2002-2007 brian d foy. All rights reserved.
115
116 This program is free software; you can redistribute it and/or modify it
117 under the same terms as Perl itself.
118
119
120
121perl v5.8.8 2007-02-22 Manifest(3)