* StringTest.cs: Added test for Concat when one of the arguments is an
[mono.git] / mono / tests / test-driver
1 #!/usr/bin/env perl 
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 @ARGV $test 2>/dev/null 1>$stdout");
15
16 if ($res) {
17         printf ("failed $? (%d) signal (%d).\n", $? >> 8, $? & 127);
18         if (($? & 127) == 2) {
19                 exit (2);
20         } else {
21                 exit (1);
22         }
23 } elsif (-f $output) {
24         print "failed output.\n" if (read_file ($output) ne read_file ($stdout));
25         exit (1);
26 } else {
27         print "pass.\n";
28         #unlink ($result);
29 }
30 exit (0);
31
32 sub read_file {
33         local ($/);
34         my $out = shift;
35         open (F, "<$out") || die $!;
36         $out = <F>;
37         close(F);
38         return $out;
39 }