/usr/share/perl5/Test/InDistDir.pm is in libtest-indistdir-perl 1.112071-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | use strict;
use warnings;
package Test::InDistDir;
our $VERSION = '1.112071'; # VERSION
# ABSTRACT: test environment setup for development with IDE
use lib;
use File::Spec;
sub import {
my $script = ( File::Spec->splitpath( $0 ) )[-1];
chdir ".." if !-f "t/$script";
lib->import( 'lib' ) if !grep { /\bblib\b/ } @INC;
return;
}
1;
__END__
=pod
=head1 NAME
Test::InDistDir - test environment setup for development with IDE
=head1 VERSION
version 1.112071
=head1 SYNOPSIS
use Test::More;
use Test::InDistDir;
# when this is run from inside t/ with a default @INC, it will now be in the
# dist dir and include ./lib in @INC
=head1 DESCRIPTION
This module helps run test scripts in IDEs like Komodo.
When running test scripts in an IDE i have to set up a project file defining the
dist dir to run tests in and a lib dir to load additional modules from. Often I
didn't feel like doing that, especially when i only wanted to do a small patch
to a dist. In those cases i added a BEGIN block to mangle the environment for
me.
This module basically is that BEGIN block. It automatically moves up one
directory when it cannot see the test script in "t/$scriptname" and includes
'lib' in @INC when there's no blib present. That way the test ends up with
almost the same environment it'd get from EUMM/prove/etc., even when it's
actually run inside the t/ directory.
At the same time it will still function correctly when called by
EUMM/prove/etc., since it does not change the environment in those cases.
=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders
=head1 SUPPORT
=head2 Bugs / Feature Requests
Please report any bugs or feature requests by email to C<bug-test-indistdir at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/Public/Dist/Display.html?Name=Test-InDistDir>. You will be automatically notified of any
progress on the request by the system.
=head2 Source Code
This is open source software. The code repository is available for
public review and contribution under the terms of the license.
L<https://github.com/wchristian/Test-InDistDir>
git clone https://github.com/wchristian/Test-InDistDir
=head1 AUTHOR
Christian Walde <walde.christian@googlemail.com>
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2011 by Christian Walde.
This is free software, licensed under:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE, Version 2, December 2004
=cut
|