Git Product home page Git Product logo

test-prereq's Introduction

Coverage Status

The Test::Prereq module

This is the README for the Test::Prereq Perl module. You're probably looking at this because you don't know where else to find what you're looking for. Read this once and you might never have to read one again for any Perl module.

Documentation

To read about Test::Prereq, look at the embedded documentation in the module itself. Inside the distribution, you can format it with perldoc:

% perldoc lib/Test/Prereq.pm

If you have already installed the module, you can specify the module name instead of the file location:

% perldoc Test::Prereq

You can read the documentation and inspect the meta data at MetaCPAN.

The standard module documentation has example uses in the SYNOPSIS section, but you can also look in the examples/ directory (if it's there), or look at the test files in t/.

Installation

You can install this module with a CPAN client, which will resolve and install the dependencies:

% cpan Test::Prereq
% cpanm Test::Prereq

You can also install directly from the distribution directory, which will also install the dependencies:

% cpan .
% cpanm .

You could install just this module manually:

% perl Makefile.PL
% make
% make test
% make install

You probably don't want to do that unless you're fiddling with the module and only want to run the tests without installing anything.

Source location

The meta data, such as the source repository and bug tracker, is in Makefile.PL or the META.* files it creates. You can find that on those CPAN web interfaces, but you can also look at files directly in the source repository:

If you find a problem, file a ticket in the issue tracker:

Getting help

Although I'm happy to hear from module users in private email, that's the best way for me to forget to do something.

Besides the issue trackers, you can find help at Perlmonks or Stackoverflow, both of which have many competent Perlers who can answer your question, almost in real time. They might not know the particulars of this module, but they can help you diagnose your problem.

You might like to read brian's Guide to Solving Any Perl Problem.

You should have received a LICENSE file, but the license is also noted in the module files. About the only thing you can't do is pretend that you wrote code that you didn't.

Good luck!

Enjoy,

brian d foy, [email protected]

test-prereq's People

Contributors

bleargh45 avatar briandfoy avatar edwardbetts avatar ggoebel avatar gregoa avatar nbezzala avatar sambrightman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

test-prereq's Issues

monkeypatching of MM_Unix fragile, prone to future breakage

This patching here: https://metacpan.org/source/BDFOY/Test-Prereq-1.038_07//Makefile.PL#L119

..is likely to not work in the future, as ExtUtils::MakeMaker undergoes refactoring. There's also no guarantee it will work in all previous releases, either.

There is a public API to control what gets installed - see INSTALL.SKIP in the ExtUtils::Install documentation.

You might also want to consider putting README.pod into MANIFEST.SKIP instead, as this file looks to be primarily for the benefit of github users, rather than those who are downloading the tarball.

Module::Build test_requires ignored

This option seems to be missing from the list of options that are processed. Can be worked around in many cases by just using build_requires.

test for ver test-prereq 1.039 fail on FreeBSD

Hi Brian,
FreeBSD-11, perl 5.20.3.
When running build-in tests for test-prereq-1.039, they fail as reported below.
I have Module::Info installed as a dependency.
If I add Module::Build to the dependencies list, tests still fail with the same complains.
Also, built-in tests for test-prereq-1.038 in the same environment pass ok.
What do you think about it?
Regards, Sergei
[[[[[[
===> Testing for p5-Test-Prereq-1.039
cd /usr/ports/devel/p5-Test-Prereq/work/Test-Prereq-1.039/ && /usr/bin/env XDG_DATA_HOME=/usr/ports/devel/p5-Test-Prereq/work XDG_CONFIG_HOME=/usr/ports/devel/p5-Test-Prereq/work HOME=/usr/ports/devel/p5-Test-Prereq/work NO_PIE=yes NO_DEBUG_FILES=yes SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local LOCALBASE=/usr/local LIBDIR="/usr/lib" CC="cc" CFLAGS="-O2 -pipe -fstack-protector -fno-strict-aliasing" CPP="cpp" CPPFLAGS="" LDFLAGS=" -fstack-protector" LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector -fno-strict-aliasing " MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 444" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" /usr/bin/make DESTDIR=/usr/ports/devel/p5-Test-Prereq/work/stage test
PERL_DL_NONLAZY=1 /usr/local/bin/perl5.20.3 "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/.t
t/get_from_file.t ....... ok

This may take awhile...
t/get_from_prereqs.t .... ok

#   Failed test 'Right modules for modules and tests'
#   at t/get_loaded_modules.t line 15.
#     Structures begin differing at:
#          $got->[0] = 'Module::Info'
#     $expected->[0] = 'Module::Build'
# Didn't find right modules!
#   Found < Module::Info Test::Prereq Test::Prereq::Build >
#   Expected < Module::Build Module::Info Test::Prereq Test::Prereq::Build >
# Looks like you failed 1 test of 1.

Failed test 'modules'

at t/get_loaded_modules.t line 18.

Looks like you failed 1 test of 2.

t/get_loaded_modules.t ..
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests
# You might see an error about loading a Makefile.PL. That's fine.
_get_prereqs: Error loading Makefile.PL:
t/get_prereqs.t ......... ok
t/import.t .............. ok
t/load.t ................ ok
t/pod.t ................. ok
t/pod_coverage.t ........ ok

Testing Perl version -> 5.020003

t/prereq_ok.t ........... ok
t/prior_plan.t .......... ok

Test Summary Report

t/get_loaded_modules.t (Wstat: 256 Tests: 2 Failed: 1)
Failed test: 2
Non-zero exit status: 1
Files=10, Tests=23, 98 wallclock secs ( 0.09 usr 0.04 sys + 96.42 cusr 2.16 csys = 98.72 CPU)
Result: FAIL
Failed 1/10 test programs. 1/23 subtests failed.
*** Error code 255

Stop.
make[1]: stopped in /usr/ports/devel/p5-Test-Prereq/work/Test-Prereq-1.039
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/p5-Test-Prereq
]]]]]

prereq_ok

prereq_ok( [ VERSION, [ NAME [, SKIP_ARRAY] ] ] )

It looks like the code isn't asking for VERSION.
When I use

prereq_ok( NAME, SKIP_ARRAY )

it works.

EUMM should be CONFIGURE_REQUIRES

Makefile.PL currently specifies

'BUILD_REQUIRES' => {
    'ExtUtils::MakeMaker'    => '6.64',
    },

but as version 6.64 is required by the Makefile.PL, it should probably be CONFIGURE_REQUIRES instead.

Undeclared dependency on Module::Build

While bisecting an unrelated issue, it appears that some of your test files use Module::Build, but Makefile.PL doesn't declare any type of dependency on Module::Build. Module::Build was in core through 5.20, but is not in core any longer. Test log below:

  BDFOY/Test-Prereq-1.039.tar.gz
  Has already been unwrapped into directory /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM
  BDFOY/Test-Prereq-1.039.tar.gz
  Has already been prepared
Running make for B/BD/BDFOY/Test-Prereq-1.039.tar.gz
cp lib/Test/Prereq/Build.pm blib/lib/Test/Prereq/Build.pm
cp lib/Test/Prereq.pm blib/lib/Test/Prereq.pm
cp README.pod blib/lib/Test/README.pod
Manifying 3 pod documents
  BDFOY/Test-Prereq-1.039.tar.gz
  /usr/bin/make -j5 -j5 -- OK
Running make test
PERL_DL_NONLAZY=1 "/tmp/QxA9SL9eol/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/get_from_file.t ....... ok
t/get_from_prereqs.t ....
This may take awhile...
t/get_from_prereqs.t .... ok
t/get_loaded_modules.t .. 1/?
    #   Failed test 'Right modules for modules and tests'
    #   at t/get_loaded_modules.t line 15.
    #     Structures begin differing at:
    #          $got->[0] = 'Module::Info'
    #     $expected->[0] = 'Module::Build'
    # Didn't find right modules!
    #   Found < Module::Info Test::Prereq Test::Prereq::Build >
    #   Expected < Module::Build Module::Info Test::Prereq Test::Prereq::Build >
    # Looks like you failed 1 test of 1.
t/get_loaded_modules.t .. 2/?
#   Failed test 'modules'
#   at t/get_loaded_modules.t line 18.
# Looks like you failed 1 test of 2.
t/get_loaded_modules.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests
t/get_prereqs.t ......... Can't locate Module/Build.pm in @INC (you may need to install the Module::Build module) (@INC contains: /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/lib /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/arch /tmp/QxA9SL9eol/lib/perl5/site_perl/5.24.0/x86_64-linux-thread-multi /tmp/QxA9SL9eol/lib/perl5/site_perl/5.24.0 /tmp/QxA9SL9eol/lib/perl5/5.24.0/x86_64-linux-thread-multi /tmp/QxA9SL9eol/lib/perl5/5.24.0 .) at /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/lib/Test/Prereq/Build.pm line 25.
BEGIN failed--compilation aborted at /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/lib/Test/Prereq/Build.pm line 25.
Compilation failed in require at t/get_prereqs.t line 7.
BEGIN failed--compilation aborted at t/get_prereqs.t line 7.
t/get_prereqs.t ......... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
t/import.t .............. 2/4 Can't locate Module/Build.pm in @INC (you may need to install the Module::Build module) (@INC contains: /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/lib /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/arch /tmp/QxA9SL9eol/lib/perl5/site_perl/5.24.0/x86_64-linux-thread-multi /tmp/QxA9SL9eol/lib/perl5/site_perl/5.24.0 /tmp/QxA9SL9eol/lib/perl5/5.24.0/x86_64-linux-thread-multi /tmp/QxA9SL9eol/lib/perl5/5.24.0 .) at /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/lib/Test/Prereq/Build.pm line 25.
BEGIN failed--compilation aborted at /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/lib/Test/Prereq/Build.pm line 25.
Compilation failed in require at t/import.t line 22.
# Looks like you planned 4 tests but ran 3.
# Looks like your test exited with 2 just after 3.
t/import.t .............. Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/4 subtests
t/load.t ................ 1/4
#   Failed test 'use Test::Prereq::Build;'
#   at t/load.t line 9.
#     Tried to use 'Test::Prereq::Build'.
#     Error:  Can't locate Module/Build.pm in @INC (you may need to install the Module::Build module) (@INC contains: /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/lib /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/arch /tmp/QxA9SL9eol/lib/perl5/site_perl/5.24.0/x86_64-linux-thread-multi /tmp/QxA9SL9eol/lib/perl5/site_perl/5.24.0 /tmp/QxA9SL9eol/lib/perl5/5.24.0/x86_64-linux-thread-multi /tmp/QxA9SL9eol/lib/perl5/5.24.0 .) at /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/lib/Test/Prereq/Build.pm line 25.
# BEGIN failed--compilation aborted at /tmp/8dwDw6dXj1/Test-Prereq-1.039-ysD1BM/blib/lib/Test/Prereq/Build.pm line 25.
# Compilation failed in require at t/load.t line 9.
# BEGIN failed--compilation aborted at t/load.t line 9.
Bailout called.  Further testing stopped:  Could not compile Test::Prereq::Build!
FAILED--Further testing stopped: Could not compile Test::Prereq::Build!
Makefile:880: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
  BDFOY/Test-Prereq-1.039.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports BDFOY/Test-Prereq-1.039.tar.gz
Stopping: 'install' failed for 'B/BD/BDFOY/Test-Prereq-1.039.tar.gz'.
Died at -e line 2.
HEAD is now at be2c0c6 final commit for v5.24.0!
bad - non-zero exit from /tmp/QxA9SL9eol/bin/perl -I /home/cpanbisect/.cpan -MCPAN::MyConfig -MCPAN -e $CPAN::Config->{build_dir}=q{/tmp/8dwDw6dXj1}; -e install('Test::Prereq'); die unless CPAN::Shell->expand(Module => 'Test::Prereq')->uptodate;
Runner returned 256, not 0 for start revision at Porting/bisect.pl line 238.
That took 532 seconds.

t/get_loaded_modules.t fails with perl 5.20.3

With perl 5.20.3 (but not with any other perl version I tried):

    #   Failed test 'Right modules for modules and tests'
    #   at t/get_loaded_modules.t line 15.
    #     Structures begin differing at:
    #          $got->[0] = 'Module::Info'
    #     $expected->[0] = 'Module::Build'
    # Didn't find right modules!
    #   Found < Module::Info Test::Prereq Test::Prereq::Build >
    #   Expected < Module::Build Module::Info Test::Prereq Test::Prereq::Build >
    # Looks like you failed 1 test of 1.

#   Failed test 'modules'
#   at t/get_loaded_modules.t line 18.
# Looks like you failed 1 test of 2.
t/get_loaded_modules.t .. 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests 
    # You might see an error about loading a Makefile.PL. That's fine.
_get_prereqs: Error loading Makefile.PL: 
t/get_prereqs.t ......... ok

TEST_REQUIRES is not a known MakeMaker parameter name

Hi,

When installing Test-Prereq-1.038 at FreeBSD 10.0 (amd64) you get:

'TEST_REQUIRES' is not a known MakeMaker parameter name.

Really, Makefile.PL has a block:
'TEST_REQUIRES' => {
'Test::Builder' => '0',
'Test::Builder::Tester' => '0',
'Test::More' => '0.95',
},
But all listed modules are core modules since very long ago.
So maybe the whole block can be safely removed?

All the best,
Sergei

Compat with older perls (Test-Prereq-2.001_001)

Compilation fails with perl 5.22.x, it seems because postderef is used:

#   Failed test 'use Test::Prereq;'
#   at t/load.t line 7.
#     Tried to use 'Test::Prereq'.
#     Error:  syntax error at /home/cpansand/.cpan/build/2016102609/Test-Prereq-2.001_001-LiUImO/blib/lib/Test/Prereq.pm line 197, near "->@* "

Additionally, the minimum perl version is set to 5.022 (see https://metacpan.org/source/BDFOY/Test-Prereq-2.001_001/META.yml#L31 ) --- probably by mistake?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.