Skip to content
Snippets Groups Projects
Commit 44ca5efe authored by benjamin.franksen's avatar benjamin.franksen
Browse files

test: further improved compiler test script

It now filters out the remaining lines that are issued by make. Also
print diagnistics only once per failed test program.
parent 3baf3a3c
No related branches found
No related tags found
No related merge requests found
......@@ -41,16 +41,19 @@ foreach my $prog (@progs) {
plan tests => 3;
my $output = `make -s -B $prog.c 2>&1`;
my $exitcode = $? >> 8;
$output =~ s/^make.*$//m;
my $failed;
SKIP: {
skip "errors are expected", 1 if $tests->{$prog}->{errors} > 0;
is($exitcode, 0, "good exitcode") or snc_diag($output);
is($exitcode, 0, "good exitcode") or $failed=1;
}
my $nw = 0;
$nw++ while ($output =~ /warning/g);
is($nw, $tests->{$prog}->{warnings}, "number of warnings") or snc_diag($output);
is($nw, $tests->{$prog}->{warnings}, "number of warnings") or $failed=1;
my $ne = 0;
$ne++ while ($output =~ /error/g);
is($ne, $tests->{$prog}->{errors}, "number of errors") or snc_diag($output);
is($ne, $tests->{$prog}->{errors}, "number of errors") or $failed=1;
snc_diag($output) if $failed;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment