#!perl
BEGIN {
unless
(
$ENV
{AUTHOR_TESTING}) {
print
"1..0 # SKIP these tests are for testing by the author"
;
exit
;
}
}
my
$config_file
=
't/author-lib.ini'
;
my
$config
= Config::Tiny ->
read
(
't/author-lib.ini'
)
or
die
Config::Tiny -> errstr();
our
$LIB
=
$config
->{_}->{lib};
die
"No library defined in file '$config_file'"
unless
defined
$LIB
;
die
"Invalid library name '$LIB' in file '$config_file'"
unless
$LIB
=~ /^[A-Za-z]\w*(::\w+)*\z/;
our
$REF
=
$config
->{_}->{
ref
};
die
"No reference type defined in file '$config_file'"
unless
defined
$REF
;
die
"Invalid reference type '$REF' in file '$config_file'"
unless
$REF
=~ /^[A-Za-z]\w*(::\w+)*\z/;
eval
"require $LIB"
;
die
$@
if
$@;
pass(
"Configuration loaded OK"
);
diag(
"\n\n$LIB version "
,
$LIB
-> VERSION(),
", Perl $], $^X\n\n"
);