Commit | Line | Data |
4176d4e4 |
1 | |
2 | use strict ; |
3 | use warnings; |
4 | |
5 | use vars qw( $Perl $Inc); |
6 | |
2c4bb738 |
7 | sub readFile |
8 | { |
9 | my ($filename) = @_ ; |
10 | my ($string) = '' ; |
11 | |
12 | open (F, "<$filename") |
13 | or die "Cannot open $filename: $!\n" ; |
14 | while (<F>) |
15 | { $string .= $_ } |
16 | close F ; |
17 | $string ; |
18 | } |
19 | |
20 | sub writeFile |
21 | { |
22 | my($filename, @strings) = @_ ; |
23 | open (F, ">$filename") |
24 | or die "Cannot open $filename: $!\n" ; |
25 | binmode(F) if $filename =~ /bin$/i; |
26 | foreach (@strings) |
27 | { print F } |
28 | close F ; |
29 | } |
30 | |
31 | sub ok |
32 | { |
33 | my($number, $result, $note) = @_ ; |
34 | |
35 | $note = "" if ! defined $note ; |
36 | if ($note) { |
37 | $note = "# $note" if $note !~ /^\s*#/ ; |
38 | $note =~ s/^\s*/ / ; |
39 | } |
40 | |
41 | print "not " if !$result ; |
42 | print "ok ${number}${note}\n"; |
43 | } |
44 | |
45 | $Inc = '' ; |
46 | foreach (@INC) |
03ec374d |
47 | { $Inc .= "\"-I$_\" " } |
2c4bb738 |
48 | |
49 | $Perl = '' ; |
50 | $Perl = ($ENV{'FULLPERL'} or $^X or 'perl') ; |
51 | |
52 | $Perl = "$Perl -w" ; |
53 | |
54 | 1; |