Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-driver « tests « mono - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f64835e290586321d4f52e303755070b0cc1ef71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl -w

my $interpreter = shift;
my $test = shift;
my $output = $test;
my $stdout = $test.'.stdout';
my $stderr = $test.'.stderr';

$output =~ s/\.exe$/.output/;

$| = 0;
print "Testing $test... ";

my $res = system("$interpreter $test 2>/dev/null 1>$stdout");

if ($res) {
	printf ("failed $? (%d) signal (%d).\n", $? >> 8, $? & 127);
	exit (1);
} elsif (-f $output) {
	print "failed output.\n" if (read_file ($output) ne read_file ($stdout));
	exit (1);
} else {
	print "pass.\n";
	#unlink ($result);
}
exit (0);

sub read_file {
	local ($/);
	my $out = shift;
	open (F, "<$out") || die $!;
	$out = <F>;
	close(F);
	return $out;
}