Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Integrated Test::Run into the Makefile.PL.

I added a Test::Run::CmdLine::T_Files module.
  • Loading branch information...
commit 43d428061b4fa9c8648cc7f78ca35c529a848b6a 1 parent 75a04fa
@shlomif shlomif authored
Showing with 40 additions and 0 deletions.
  1. +12 −0 Makefile.PL
  2. +28 −0 testlib/Test/Run/CmdLine/T_Files.pm
View
12 Makefile.PL
@@ -52,4 +52,16 @@ keywords(
catalyst;
install_script glob('script/*.pl');
+postamble(<<'MAKE_FRAG');
+
+runtest: pure_all
+ $(PERLRUNINST) -Itestlib -MTest::Run::CmdLine::T_Files -e "run_t($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)', $(TEST_LEVEL));"
+
+distruntest: distdir
+ cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
+ cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
+ cd $(DISTVNAME) && $(MAKE) runtest $(PASTHRU)
+
+MAKE_FRAG
+
WriteAll;
View
28 testlib/Test/Run/CmdLine/T_Files.pm
@@ -0,0 +1,28 @@
+package Test::Run::CmdLine::T_Files;
+
+use strict;
+use warnings;
+
+use File::Spec;
+use base 'Exporter';
+
+use vars qw(@EXPORT);
+
+@EXPORT = (qw(run_t));
+
+sub run_t
+{
+ require Test::Run::CmdLine::Iface;
+ my ($test_verbose, $inst_lib, $inst_archlib, $test_level) = @_;
+ local @INC = @INC;
+ unshift @INC, map { File::Spec->rel2abs($_) } ($inst_lib, $inst_archlib);
+
+ my $test_iface = Test::Run::CmdLine::Iface->new({
+ test_files => [glob("t/*.t")]
+ }
+ );
+
+ return $test_iface->run();
+}
+
+1;
Please sign in to comment.
Something went wrong with that request. Please try again.