Commit | Line | Data |
f6d6199c |
1 | package ExtUtils::Command::MM; |
2 | |
3 | use strict; |
4 | |
5 | require 5.006; |
6 | require Exporter; |
7 | use vars qw($VERSION @ISA @EXPORT); |
8 | @ISA = qw(Exporter); |
9 | |
10 | @EXPORT = qw(test_harness); |
11 | $VERSION = '0.01'; |
12 | |
13 | =head1 NAME |
14 | |
15 | ExtUtils::Command::MM - Commands for the MM's to use in Makefiles |
16 | |
17 | =head1 SYNOPSIS |
18 | |
19 | perl -MExtUtils::Command::MM -e "function" files... |
20 | |
21 | |
22 | =head1 DESCRIPTION |
23 | |
24 | B<FOR INTERNAL USE ONLY!> The interface is not stable. |
25 | |
26 | ExtUtils::Command::MM encapsulates code which would otherwise have to |
27 | be done with large "one" liners. |
28 | |
29 | They all read their input from @ARGV unless otherwise noted. |
30 | |
31 | Any $(FOO) used in the examples are make variables, not Perl. |
32 | |
33 | =over 4 |
34 | |
35 | =item B<test_harness> |
36 | |
e0678a30 |
37 | test_harness($verbose, @test_libs); |
f6d6199c |
38 | |
e0678a30 |
39 | Runs the tests on @ARGV via Test::Harness passing through the $verbose |
40 | flag. Any @test_libs will be unshifted onto the test's @INC. |
f6d6199c |
41 | |
42 | =cut |
43 | |
44 | sub test_harness { |
45 | require Test::Harness; |
e0678a30 |
46 | require File::Spec; |
47 | |
f6d6199c |
48 | $Test::Harness::verbose = shift; |
e0678a30 |
49 | |
50 | local @INC = @INC; |
51 | unshift @INC, map { File::Spec->rel2abs($_) } @_; |
f6d6199c |
52 | Test::Harness::runtests(@ARGV); |
53 | } |
54 | |
55 | =back |
56 | |
57 | =cut |
58 | |
59 | 1; |