t/README Instructions for regression tests
t/TEST The regression tester
t/UTEST Run regression tests with -Mutf8
+t/base/commonsense.t See if configuration meets basic needs
t/base/cond.t See if conditionals work
t/base/if.t See if if works
t/base/lex.t See if lexical items work
+# -*- Mode: cperl; cperl-indent-level: 4 -*-
package Test::Harness;
use 5.005_64;
$columns, @ISA, @EXPORT, @EXPORT_OK);
$have_devel_corestack = 0;
-$VERSION = "1.1605";
+$VERSION = "1.1606";
$ENV{HARNESS_ACTIVE} = 1;
$next = $this;
}
$next = $this + 1;
- }
+ } elsif (/^Bail out!\s*(.*)/i) { # magic words
+ die "FAILED--Further testing stopped" . ($1 ? ": $1\n" : ".\n");
+ }
}
$fh->close; # must close to reap child resource values
my $wstatus = $ignore_exitcode ? 0 : $?; # Can trust $? ?
}
}
my $t_total = timediff(new Benchmark, $t_start);
-
+
if ($^O eq 'VMS') {
if (defined $old5lib) {
$ENV{PERL5LIB} = $old5lib;
ok
END
-will generate
+will generate
FAILED tests 1, 3, 6
Failed 3/6 tests, 50.00% okay
1..0 # Skipped: no leverage found
+As an emergency measure, a test script can decide that further tests
+are useless (e.g. missing dependencies) and testing should stop
+immediately. In that case the test script prints the magic words
+
+ Bail out!
+
+to standard output. Any message after these words will be displayed by
+C<Test::Harness> as the reason why testing is stopped.
+
=head1 EXPORT
C<&runtests> is exported by Test::Harness per default.
If not all tests were successful, the script dies with one of the
above messages.
+=item C<FAILED--Further testing stopped%s>
+
+If a single subtest decides that further testing will not make sense,
+the script dies with this message.
+
=back
=head1 ENVIRONMENT
$next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
if (/^ok (\d+)(\s*#.*)?$/ && $1 == $next) {
$next = $next + 1;
+ }
+ elsif (/^Bail out!\s*(.*)/i) { # magic words
+ die "FAILED--Further testing stopped" . ($1 ? ": $1\n" : ".\n");
}
else {
$ok = 0;
$next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
if (/^ok (\d+)(\s*#.*)?$/ && $1 == $next) {
$next = $next + 1;
+ }
+ elsif (/^Bail out!\s*(.*)/i) { # magic words
+ die "FAILED--Further testing stopped" . ($1 ? ": $1\n" : ".\n");
}
else {
$ok = 0;
--- /dev/null
+#!./perl
+
+chdir 't' if -d 't';
+@INC = '../lib';
+require Config; import Config;
+if (($Config{'extensions'} !~ /\b(DB|[A-Z]DBM)_File\b/) ){
+ print "Bail out! Perl configured without DB_File or [A-Z]DBM_File\n";
+ exit 0;
+}
+if (($Config{'extensions'} !~ /\bFcntl\b/) ){
+ print "Bail out! Perl configured without Fcntl module\n";
+ exit 0;
+}
+if (($Config{'extensions'} !~ /\bIO\b/) ){
+ print "Bail out! Perl configured without IO module\n";
+ exit 0;
+}
+if (($Config{'extensions'} !~ /\bFile\/Glob\b/) ){
+ print "Bail out! Perl configured without File::Glob module\n";
+ exit 0;
+}
+
+print "1..1\nok 1\n";
+