Test-InDistDir-1.112071000755000000000000 011613576564 15061 5ustar00unknownunknown000000000000Changes100644000000000000 16711613576564 16421 0ustar00unknownunknown000000000000Test-InDistDir-1.112071Revision history for Perl extension Test-InDistDir 1.112071 2011-07-26 19:46:24 Europe/Berlin - original version LICENSE100644000000000000 121511613576564 16146 0ustar00unknownunknown000000000000Test-InDistDir-1.112071This 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 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. dist.ini100644000000000000 502311613576564 16606 0ustar00unknownunknown000000000000Test-InDistDir-1.112071name = Test-InDistDir author = Christian Walde license = WTFPL_2 copyright_holder = Christian Walde copyright_year = 2011 ; version provider [AutoVersion] ; builds a version automatically from the date ; choose files to include [GatherDir] ; everything under top dir [PruneCruft] ; default stuff to skip [ManifestSkip] ; if -f MANIFEST.SKIP, skip those, too ; file modifications [OurPkgVersion] ; add $VERSION = ... to all files [PodWeaver] ; generate Pod config_plugin = @DAGOLDEN ; my own plugin allows Pod::WikiDoc ; generated files [License] ; boilerplate license [ReadmeMarkdownFromPod] ; from Pod (runs after PodWeaver) [CopyReadmeFromBuild] ; for the repo ; t tests [CompileTests] ; make sure .pm files all compile fake_home = 1 ; fakes $ENV{HOME} just in case ; xt tests [MetaTests] ; xt/release/meta-yaml.t [PodSyntaxTests] ; xt/release/pod-syntax.t [PodCoverageTests] ; xt/release/pod-coverage.t [PortabilityTests] ; xt/release/portability.t (of file name) [KwaliteeTests] ; xt/release/kwalitee.t [Test::Version] ; xt/release/test-version.t ; metadata [AutoPrereqs] ; find prereqs from code [MinimumPerl] ; determine minimum perl version [GithubMeta] [MetaNoIndex] ; sets 'no_index' in META directory = t directory = xt directory = examples directory = corpus package = DB ; just in case [Bugtracker] ; defaults to RT [MetaProvides::Package] ; add 'provides' to META files meta_noindex = 1 ; respect prior no_index directives [MetaYAML] ; generate META.yml (v1.4) [MetaJSON] ; generate META.json (v2) ; build system [ExecDir] ; include 'bin/*' as executables [ShareDir] ; include 'share/' for File::ShareDir [MakeMaker] ; create Makefile.PL ; manifest (after all generated files) [Manifest] ; create MANIFEST ; before release [Git::Check] ; ensure all files checked in allow_dirty = README.mkdn [CheckPrereqsIndexed] ; ensure prereqs are on CPAN [CheckChangesHasContent] ; ensure Changes has been updated [CheckExtraTests] ; ensure xt/ tests pass [TestRelease] ; ensure t/ tests pass [ConfirmRelease] ; prompt before uploading ; releaser [UploadToCPAN] ; uploads to CPAN ; after release [NextRelease] [Git::Commit] allow_dirty = Changes allow_dirty = README.mkdn [Git::Tag] ; tag repo with custom tag tag_format = release-%v [Git::Push] ; push repo to remote push_to = origin META.yml100644000000000000 161411613576564 16415 0ustar00unknownunknown000000000000Test-InDistDir-1.112071--- abstract: 'test environment setup for development with IDE' author: - 'Christian Walde ' build_requires: File::Find: 0 File::Temp: 0 Test::More: 0 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.200013, CPAN::Meta::Converter version 2.110930' license: unrestricted meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Test-InDistDir no_index: directory: - t - xt - examples - corpus package: - DB provides: Test::InDistDir: file: lib/Test/InDistDir.pm version: 1.112071 requires: File::Spec: 0 perl: 5.006 resources: bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Test-InDistDir homepage: https://github.com/wchristian/Test-InDistDir repository: https://github.com/wchristian/Test-InDistDir version: 1.112071 MANIFEST100644000000000000 41511613576564 16253 0ustar00unknownunknown000000000000Test-InDistDir-1.112071Changes LICENSE MANIFEST META.json META.yml Makefile.PL README.mkdn dist.ini lib/Test/InDistDir.pm t/00-compile.t t/basic.t xt/release/distmeta.t xt/release/kwalitee.t xt/release/pod-coverage.t xt/release/pod-syntax.t xt/release/portability.t xt/release/test-version.t t000755000000000000 011613576564 15245 5ustar00unknownunknown000000000000Test-InDistDir-1.112071basic.t100644000000000000 76711613576564 16645 0ustar00unknownunknown000000000000Test-InDistDir-1.112071/tuse strict; use warnings; package basic; use Test::More; use File::Spec; require_ok("Test::InDistDir"); can_ok( "Test::InDistDir", "import" ); chdir "t" if -d "t"; @INC = grep { !/\bblib\b/ and !/\blib\b/ } @INC; my $script = ( File::Spec->splitpath( $0 ) )[-1]; ok( !-f "t/$script", "test script not visible" ); Test::InDistDir->import; ok( -f "t/$script", "we moved up one directory, so test script is visible" ); ok( scalar( grep { /\blib\b/ } @INC ), "lib was added to INC" ); done_testing; META.json100644000000000000 320111613576564 16557 0ustar00unknownunknown000000000000Test-InDistDir-1.112071{ "abstract" : "test environment setup for development with IDE", "author" : [ "Christian Walde " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.200013, CPAN::Meta::Converter version 2.110930", "license" : [ "unrestricted" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Test-InDistDir", "no_index" : { "directory" : [ "t", "xt", "examples", "corpus" ], "package" : [ "DB" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "runtime" : { "requires" : { "File::Spec" : 0, "perl" : "5.006" } }, "test" : { "requires" : { "File::Find" : 0, "File::Temp" : 0, "Test::More" : 0 } } }, "provides" : { "Test::InDistDir" : { "file" : "lib/Test/InDistDir.pm", "version" : "1.112071" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-test-indistdir at rt.cpan.org", "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Test-InDistDir" }, "homepage" : "https://github.com/wchristian/Test-InDistDir", "repository" : { "type" : "git", "url" : "https://github.com/wchristian/Test-InDistDir", "web" : "https://github.com/wchristian/Test-InDistDir" } }, "version" : "1.112071" } README.mkdn100644000000000000 405011613576564 16751 0ustar00unknownunknown000000000000Test-InDistDir-1.112071# NAME Test::InDistDir - test environment setup for development with IDE # VERSION version 1.112071 # 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 # 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. # SUPPORT ## Bugs / Feature Requests Please report any bugs or feature requests by email to `bug-test-indistdir at rt.cpan.org`, or through the web interface at [http://rt.cpan.org/Public/Dist/Display.html?Name=Test-InDistDir](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. ## Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. [https://github.com/wchristian/Test-InDistDir](https://github.com/wchristian/Test-InDistDir) git clone https://github.com/wchristian/Test-InDistDir # AUTHOR Christian Walde # 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 2004Makefile.PL100644000000000000 214111613576564 17112 0ustar00unknownunknown000000000000Test-InDistDir-1.112071 use strict; use warnings; use 5.006; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( 'ABSTRACT' => 'test environment setup for development with IDE', 'AUTHOR' => 'Christian Walde ', 'BUILD_REQUIRES' => { 'File::Find' => '0', 'File::Temp' => '0', 'Test::More' => '0' }, 'CONFIGURE_REQUIRES' => { 'ExtUtils::MakeMaker' => '6.30' }, 'DISTNAME' => 'Test-InDistDir', 'EXE_FILES' => [], 'LICENSE' => 'unrestricted', 'NAME' => 'Test::InDistDir', 'PREREQ_PM' => { 'File::Spec' => '0' }, 'VERSION' => '1.112071', 'test' => { 'TESTS' => 't/*.t' } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); 00-compile.t100644000000000000 227511613576564 17445 0ustar00unknownunknown000000000000Test-InDistDir-1.112071/t#!perl use strict; use warnings; use Test::More; use File::Find; use File::Temp qw{ tempdir }; my @modules; find( sub { return if $File::Find::name !~ /\.pm\z/; my $found = $File::Find::name; $found =~ s{^lib/}{}; $found =~ s{[/\\]}{::}g; $found =~ s/\.pm$//; # nothing to skip push @modules, $found; }, 'lib', ); my @scripts; if ( -d 'bin' ) { find( sub { return unless -f; my $found = $File::Find::name; # nothing to skip push @scripts, $found; }, 'bin', ); } my $plan = scalar(@modules) + scalar(@scripts); $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run"); { # fake home for cpan-testers local $ENV{HOME} = tempdir( CLEANUP => 1 ); like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" ) for sort @modules; SKIP: { eval "use Test::Script 1.05; 1;"; skip "Test::Script needed to test script compilation", scalar(@scripts) if $@; foreach my $file ( @scripts ) { my $script = $file; $script =~ s!.*/!!; script_compiles( $file, "$script script compiles" ); } } } Test000755000000000000 011613576564 16467 5ustar00unknownunknown000000000000Test-InDistDir-1.112071/libInDistDir.pm100644000000000000 472711613576564 21030 0ustar00unknownunknown000000000000Test-InDistDir-1.112071/lib/Testuse 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, or through the web interface at L. 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 git clone https://github.com/wchristian/Test-InDistDir =head1 AUTHOR Christian Walde =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 release000755000000000000 011613576564 17055 5ustar00unknownunknown000000000000Test-InDistDir-1.112071/xtdistmeta.t100644000000000000 21711613576564 21174 0ustar00unknownunknown000000000000Test-InDistDir-1.112071/xt/release#!perl use Test::More; eval "use Test::CPAN::Meta"; plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; meta_yaml_ok(); kwalitee.t100644000000000000 17611613576564 21173 0ustar00unknownunknown000000000000Test-InDistDir-1.112071/xt/release#!perl use Test::More; eval "use Test::Kwalitee"; plan skip_all => "Test::Kwalitee required for testing kwalitee" if $@; pod-syntax.t100644000000000000 21211613576564 21463 0ustar00unknownunknown000000000000Test-InDistDir-1.112071/xt/release#!perl use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); portability.t100644000000000000 24111613576564 21721 0ustar00unknownunknown000000000000Test-InDistDir-1.112071/xt/release#!perl use Test::More; eval "use Test::Portability::Files"; plan skip_all => "Test::Portability::Files required for testing portability" if $@; run_tests(); pod-coverage.t100644000000000000 52711613576564 21741 0ustar00unknownunknown000000000000Test-InDistDir-1.112071/xt/release#!perl use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); test-version.t100644000000000000 32511613576564 22024 0ustar00unknownunknown000000000000Test-InDistDir-1.112071/xt/release#!/usr/bin/perl use 5.006; use strict; use warnings; use Test::More; eval "use Test::Version 0.04"; plan skip_all => "Test::Version 0.04 required for testing versions" if $@; version_all_ok(); done_testing;