This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
new test (from Michael G Schwern <schwern@pobox.com>)
[perl5.git] / t / pragma / diagnostics.t
CommitLineData
f5ad5489
GS
1#!./perl
2
3BEGIN {
4 chdir '..' if -d '../pod';
5 unshift @INC, './lib' if -d './lib';
6}
7
8
9######################### We start with some black magic to print on failure.
10
11# Change 1..1 below to 1..last_test_to_print .
12# (It may become useful if the test is moved to ./t subdirectory.)
13use strict;
14
15use vars qw($Test_Num $Total_tests);
16
17my $loaded;
18BEGIN { $| = 1; $^W = 1; $Test_Num = 1 }
19END {print "not ok $Test_Num\n" unless $loaded;}
20print "1..$Total_tests\n";
21BEGIN { require diagnostics; } # Don't want diagnostics' noise yet.
22$loaded = 1;
23ok($loaded, 'compile');
24######################### End of black magic.
25
26sub ok {
27 my($test, $name) = shift;
28 print "not " unless $test;
29 print "ok $Test_Num";
30 print " - $name" if defined $name;
31 print "\n";
32 $Test_Num++;
33}
34
35
36# Change this to your # of ok() calls + 1
37BEGIN { $Total_tests = 1 }