3b9c1748b1dc5420c804ceb7ee07d6f360213a05
[dbsrgits/DBIx-Class.git] / maint / Makefile.PL.inc / 11_authortests.pl
1 require File::Spec;
2 require File::Find;
3
4 my $xt_dirs;
5 File::Find::find(sub {
6   return if $xt_dirs->{$File::Find::dir};
7   $xt_dirs->{$File::Find::dir} = 1 if (
8     $_ =~ /\.t$/ and -f $_
9   );
10 }, 'xt');
11
12 my $xt_tests = join (' ', map { File::Spec->catfile($_, '*.t') } sort keys %$xt_dirs );
13
14 # this will add the xt tests to the `make test` target among other things
15 Meta->tests(join (' ', map { $_ || () } Meta->tests, $xt_tests ) );
16
17 # inject an explicit xt test run for making a tarball (distdir is exempt)
18 postamble <<"EOP";
19
20 .PHONY: test_xt
21
22 dist : test_xt
23
24 test_xt :
25 \tPERL_DL_NONLAZY=1 RELEASE_TESTING=1 \$(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness(\$(TEST_VERBOSE), 'inc', '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $xt_tests
26
27 EOP
28
29
30 # keep the Makefile.PL eval happy
31 1;