Permalink
Browse files

Add DC::Test::Dist test distribution.

  • Loading branch information...
1 parent 3b6e3f9 commit 36854e38471f05d9df352c9b4b9a37b8326b0197 @pjcj committed Apr 2, 2012
Showing with 188 additions and 12 deletions.
  1. +12 −12 MANIFEST.SKIP
  2. +1 −0 bin/cover
  3. +1 −0 lib/Devel/Cover.pm
  4. +29 −0 tests/dist/Makefile.PL
  5. +67 −0 tests/dist/lib/DC/Test/Dist.pm
  6. +65 −0 tests/dist/lib/DC/Test/Dist/M1.pm
  7. +13 −0 tests/dist/t/t1.t
View
@@ -2,27 +2,27 @@
\.bak$
~$
\.orig$
-^Makefile$
-^Makefile\.old$
-^blib
-^pm_to_blib$
+Makefile$
+Makefile\.old$
+blib/
+pm_to_blib$
\.version$
^t/e2e/
\.gz$
\.c$
\.o$
\.bs$
-^cover_db/
+cover_db/
core$
-.out$
+\.out$
lib/Devel/Cover/Inc.pm$
^Devel-Cover-
-.patch$
-.rej$
-.debug$
+\.patch$
+\.rej$
+\.debug$
^tmp/
^bugs/
-.git/
-.tar.bz2$
-^MYMETA.
+\.git/
+\.tar.bz2$
+MYMETA\.
tags
View
@@ -220,6 +220,7 @@ sub main
my $xs = sub { utime $t, $t, $_ if /\.(xs|c|h)$/ };
File::Find::find({ wanted => $xs, no_chdir => 0 }, ".");
}
+ system "env | grep -i cover | sort";
print STDERR "cover: running $test\n";
system $test;
$Options->{report} ||= "html";
View
@@ -549,6 +549,7 @@ sub use_file
my $f = normalised_file($file);
+ # print STDERR "checking <$file> <$f>\n";
# print STDERR "checking <$file> <$f> against ",
# "select(@Select_re), ignore(@Ignore_re), inc(@Inc_re)\n";
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+
+# Copyright 2012, Paul Johnson (pjcj@cpan.org)
+
+# This software is free. It is licensed under the same terms as Perl itself.
+
+# The latest version of this software should be available from my homepage:
+# http://www.pjcj.net
+
+require 5.006001;
+
+use strict;
+use warnings;
+
+use ExtUtils::MakeMaker;
+
+# VERSION
+our $LVERSION = do { eval '$VERSION' || "0.001" }; # for development purposes
+
+$ExtUtils::MakeMaker::Verbose = 0;
+
+WriteMakefile
+(
+ NAME => "DC::Test::Dist",
+ VERSION => $LVERSION,
+ AUTHOR => 'Paul Johnson <pjcj@cpan.org>',
+ ABSTRACT_FROM => "lib/DC/Test/Dist.pm",
+ clean => { FILES => "cover_db" },
+);
@@ -0,0 +1,67 @@
+# Copyright 2012, Paul Johnson (pjcj@cpan.org)
+
+# This software is free. It is licensed under the same terms as Perl itself.
+
+# The latest version of this software should be available from my homepage:
+# http://www.pjcj.net
+
+package DC::Test::Dist;
+
+use strict;
+use warnings;
+
+# VERSION
+
+use DC::Test::Dist::M1;
+
+sub new
+{
+ bless {}, shift
+}
+
+sub d1
+{
+ my $self = shift;
+ if (@_)
+ {
+ $self->{d1} = shift;
+ }
+ $self->{d1}
+}
+
+sub d2
+{
+ my $self = shift;
+ if (@_)
+ {
+ $self->{d2} = shift;
+ }
+ $self->{d2}
+}
+
+1
+
+__END__
+
+=head1 NAME
+
+DC::Test::Dist - Devel::Cover distribution test module
+
+=head1 SYNOPSIS
+
+This module is only used as a Devel::Cover test of a complete distribution.
+
+=head1 DESCRIPTION
+
+None.
+
+=head1 LICENCE
+
+Copyright 2012, Paul Johnson (pjcj@cpan.org)
+
+This software is free. It is licensed under the same terms as Perl itself.
+
+The latest version of this software should be available from my homepage:
+http://www.pjcj.net
+
+=cut
@@ -0,0 +1,65 @@
+# Copyright 2012, Paul Johnson (pjcj@cpan.org)
+
+# This software is free. It is licensed under the same terms as Perl itself.
+
+# The latest version of this software should be available from my homepage:
+# http://www.pjcj.net
+
+package DC::Test::Dist::M1;
+
+use strict;
+use warnings;
+
+# VERSION
+
+sub new
+{
+ bless {}, shift
+}
+
+sub m1
+{
+ my $self = shift;
+ if (@_)
+ {
+ $self->{m1} = shift;
+ }
+ $self->{m1}
+}
+
+sub m2
+{
+ my $self = shift;
+ if (@_)
+ {
+ $self->{m2} = shift;
+ }
+ $self->{m2}
+}
+
+1
+
+__END__
+
+=head1 NAME
+
+DC::Test::Dist::M1 - Devel::Cover distribution test submodule
+
+=head1 SYNOPSIS
+
+This module is only used as a Devel::Cover test of a complete distribution.
+
+=head1 DESCRIPTION
+
+None.
+
+=head1 LICENCE
+
+Copyright 2012, Paul Johnson (pjcj@cpan.org)
+
+This software is free. It is licensed under the same terms as Perl itself.
+
+The latest version of this software should be available from my homepage:
+http://www.pjcj.net
+
+=cut
View
@@ -0,0 +1,13 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+use DC::Test::Dist;
+
+my $d = DC::Test::Dist->new;
+
+$d->d1("a");
+is $d->d1, "a", "d1 correctly set and retrieved";
+
+done_testing

0 comments on commit 36854e3

Please sign in to comment.