[Reproducible-commits] [libextutils-depends-perl] 164/187: Test old/new schemes with .pm files.
Maria Valentina Marin Rodrigues
akira-guest at moszumanska.debian.org
Wed Jan 21 21:17:00 UTC 2015
This is an automated email from the git hooks/post-receive script.
akira-guest pushed a commit to branch pu/reproducible_builds
in repository libextutils-depends-perl.
commit 18f44c9d5e1d5970a6a008992bc9e681ee5da713
Author: Ed J <mohawk2 at users.noreply.github.com>
Date: Mon Aug 11 18:32:00 2014 +0100
Test old/new schemes with .pm files.
---
t/02_save_load.t | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/t/02_save_load.t b/t/02_save_load.t
index caae791..4201504 100644
--- a/t/02_save_load.t
+++ b/t/02_save_load.t
@@ -7,6 +7,8 @@ use Test::More;
use FindBin;
use lib "$FindBin::Bin/lib";
use TestHelper;
+use File::Path 'mkpath';
+use File::Spec::Functions 'catdir';
use ExtUtils::Depends;
@@ -41,21 +43,19 @@ my @installed_files = qw(dep.h
$dep_info->install (@installed_files);
my $INC_FRAG = '-Ddistinctive';
-map { make_fake($_) } qw(PkgStorenew PkgStoreold);
-sub PkgStorenew::Install::Files::Inline { +{ INC => $INC_FRAG } }
-sub PkgStorenew::Install::Files::deps { qw(PkgStoreold) }
-{
- no warnings 'once';
- @PkgStoreold::Install::Files::deps = qw(PkgStorenew);
- $PkgStoreold::Install::Files::inc = $INC_FRAG;
- $PkgStoreold::Install::Files::libs = '';
-}
-sub make_fake {
- my $class = shift . '::Install::Files';
- my @pieces = split '::', $class;
- require File::Spec;
- my $pm = join('/', @pieces) . '.pm';
- $INC{$pm} = File::Spec->catdir(qw(build fake), split '/', $pm);
+make_test_pkg('PkgStorenew', <<EOF);
+sub Inline { +{ INC => '$INC_FRAG' } }
+sub deps { qw(PkgStoreold) }
+EOF
+make_test_pkg('PkgStoreold', "\@deps = qw(PkgStorenew); \$inc = '$INC_FRAG';");
+sub make_test_pkg {
+ my ($base, $text) = @_;
+ my $dir = catdir($tmp_inc, $base, qw(Install));
+ mkpath($dir, 0, 0711);
+ local *FH;
+ open FH, '>', catfile($dir, 'Files.pm');
+ print FH sprintf "package %s;\n%s\n1;\n", $base . '::Install::Files', $text;
+ close FH;
}
sub test_load {
my ($info, $msg) = @_;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/libextutils-depends-perl.git
More information about the Reproducible-commits
mailing list