Skip to content

Commit

Permalink
Add 'BAIL_OUT' to test suite upon prerequisite failure (commonly Pars…
Browse files Browse the repository at this point in the history
…e::RecDescent).
  • Loading branch information
daoswald committed Jan 22, 2012
1 parent 0e136a9 commit 4dfac0d
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CPP.pm
Expand Up @@ -18,7 +18,7 @@ use vars qw(@ISA $VERSION);
@ISA = qw(Inline::C);

# Development releases will have a _0xx version suffix.
$VERSION = '0.33_005';
$VERSION = '0.33_006';
$VERSION = eval $VERSION; # To accommodate dev. version numbers.


Expand Down
6 changes: 6 additions & 0 deletions Changes
@@ -1,4 +1,10 @@
Revision history for Perl extension Inline::CPP.
0.33_006 Sun Jan 22 05:59:00 PST 2011
[Patches by David Oswald]
- Set 00load_prereqs.t to BAIL_OUT if Parse::RecDescent can't be found.
- Add an INSTALL file explaining to pre-install Parse::RecDescent if the
common issue occurs.
- Tweaks to the distribution framework.
0.33_005 Sat Jan 21 00:36:00 PST 2011
[Added suggestion from sisyphus]
- Created a 00load_prereqs.t test to provide better diagnostics when
Expand Down
34 changes: 34 additions & 0 deletions INSTALL
@@ -0,0 +1,34 @@
Installing Inline::CPP

For most installations, the following should be all that is necessary:

cpan install Inline::CPP

...or...

Download the distribution's .tar.gz file, unpack it into its own directory,
then repeat after me:

perl Makefile.PL
make
make test
make install


*** Note regarding Parse::RecDescent dependency ***

There seem to be a growing number of cases where the automated tools
such as 'cpan' and CPANPLUS fail to cleanly install Parse::RecDescent, which
is an important prerequisite for Inline::CPP

If you experience difficulty installing Inline::CPP where the test suite fails
with a message about Parse::RecDescent, install Parse::RecDescent first, then
go ahead and try installing Inline::CPP again.


--- Other considerations ---

At install time you will be prompted about what C++ compiler and accompanying
library to use. Under most circumstances just accepting the defaults will
be fine. The best possible situation is to use the same compiler (or
compiler family) as what was used to compile Perl.
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -4,6 +4,7 @@ MANIFEST
MANIFEST.SKIP
Makefile.PL
README
INSTALL
TESTED
grammar/grammar.pm
grammar/Makefile.PL
Expand Down
2 changes: 1 addition & 1 deletion META.json
Expand Up @@ -39,5 +39,5 @@
}
},
"release_status" : "testing",
"version" : "0.33_005"
"version" : "0.33_006"
}
2 changes: 1 addition & 1 deletion META.yml
Expand Up @@ -21,4 +21,4 @@ requires:
Inline: 0.49
Inline::C: 0.49
Parse::RecDescent: 0
version: 0.33_005
version: 0.33_006
17 changes: 14 additions & 3 deletions README
Expand Up @@ -33,9 +33,9 @@ When run, this complete program prints:
-----------------------------------------------------------------------------
FEATURES:

Inline::CPP version 0.33_005 is a dev. release. It adds a test to provide
more thorough diagnostics for the "Can't find Parse::RecDescent" issue.
It's being pushed to CPAN to generate fresh smoke tests.
Inline::CPP version 0.33_006 is a dev. release. It focuses on documenting the
install issue relating to the Parse::RecDescent dependency. See INSTALL
for details if you experience problems installing Inline::CPP.

The most recent stable release is 0.33. Releases ending in _xxx are
experimental/developmental.
Expand All @@ -54,11 +54,22 @@ make test
make install

(On ActivePerl for MSWin32, use nmake instead of make.)
(On Strawberry Perl you may use dmake instead.)

You have to 'make install' before you can run it successfully.
You will be prompted for what C++ compiler and library to use. Accepting
the default should work in nearly every case (and if it doesn't, let me know).

*** A note about Parse::RecDescent ***

A growing number of smoke testers are reporting that the automated install
tools such as 'cpan' and CPANPLUS are not properly installing the
prerequisite Parse::RecDescent. If you see the Inline::CPP test suite failing
with a message about Parse::RecDescent, try installing that module first,
independently of Inline::CPP. After installing Parse::RecDescent first,
you should now be able to install Inline::CPP as documented above.


-----------------------------------------------------------------------------
INFORMATION:

Expand Down
2 changes: 1 addition & 1 deletion grammar/grammar.pm
Expand Up @@ -4,7 +4,7 @@ use strict;
use vars qw($TYPEMAP_KIND $VERSION $class_part $class_decl $star);

# Dev versions will have a _0xx suffix.
$VERSION = '0.33_005';
$VERSION = '0.33_006';
$VERSION = eval $VERSION; # To accommodate dev version numbers.

# Parse::RecDescent 1.90 and later have an incompatible change
Expand Down
10 changes: 7 additions & 3 deletions t/00load_prereqs.t
@@ -1,16 +1,20 @@

use strict;
use warnings;
use Test::More;

BEGIN {
diag( "\$ENV{PERL5LIB}: $ENV{PERL5LIB}\n" );
};

# If Parse::RecDescent isn't cleanly installed there's no point continuing
# the test suite.

BEGIN {
use_ok( 'Parse::RecDescent' )
or BAIL_OUT(
"*** YOU MUST INSTALL Parse::RecDescent BEFORE PROCEEDING ***\n"
"*** YOU MUST INSTALL Parse::RecDescent BEFORE PROCEEDING ***\n" .
"*** After confirming a clean install of Parse::RecDescent, " .
"you may re-attempt to install Inline::CPP. If that doesn't " .
"help, please file a bug report. ***\n"
);
require_ok( 'Inline::C' );
}
Expand Down

0 comments on commit 4dfac0d

Please sign in to comment.