more tests
[mono.git] / mono / tests / test-driver
1 #!/usr/bin/perl -w
2
3 my $interpreter = shift;
4 my $test = shift;
5 my $output = $test;
6 my $stdout = $test.'.stdout';
7 my $stderr = $test.'.stderr';
8
9 $output =~ s/\.exe$/.output/;
10
11 $| = 0;
12 print "Testing $test... ";
13
14 my $res = system("$interpreter $test 2>/dev/null 1>$stdout");
15
16 if ($res) {
17         printf ("failed $? (%d) signal (%d).\n", $? >> 8, $? & 127);
18 } elsif (-f $output) {
19         print "failed output.\n" if (read_file ($output) ne read_file ($stdout));
20 } else {
21         print "pass.\n";
22         #unlink ($result);
23 }
24 exit (0);
25
26 sub read_file {
27         local ($/);
28         my $out = shift;
29         open (F, "<$out") || die $!;
30         $out = <F>;
31         close(F);
32         return $out;
33 }