Commit da588093 authored by Guillaume Huard's avatar Guillaume Huard
Browse files

Better handling of characters and signals

parent 87f7c908
......@@ -377,7 +377,7 @@ sub add_values($$) {
sub preformat($) {
my $line = shift;
$line =~ s/^/>/gm;
$line =~ s/[^[:print:]\s]/./g;
$line =~ s/[^\p{XPosixPrint}\p{XPosixSpace}]/./g;
return $line;
}
......@@ -512,8 +512,14 @@ sub perform_tests($$) {
} else {
$details .= "\n";
}
if (!$result && ($part eq 'signal') && ($data->{signal} == 9)) {
$details .= "Looks like a timeout, did you write an infinite loop ?\n";
if (!$result && ($part eq 'signal')) {
if ($data->{signal} == 9) {
$details .= "Looks like a timeout, did you write an infinite loop ?\n";
}
elsif ($data->{signal} == 13) {
$details .= "Looks like your program produces to much output on stdout/stderr.".
" This might be caused by an infinite loop.\n";
}
}
}
}
......
......@@ -133,7 +133,7 @@ echo "Hello world !"
#!/bin/bash
while /usr/bin/true
do
echo "Hello world !"
echo "Salut à tous !"
done
sleep 5
#+END_SRC
......@@ -142,9 +142,9 @@ echo "Hello world !"
$cases->{"limites.sh"} = {
code => 0, signal => 0,
tests => {
test_1 => { timeout => 2 },
test_1 => { timeout => 1 },
test_2 => { output_limit => 1 },
test_3 => { output_limit => 1, timeout => 2 }
test_3 => { output_limit => 1, timeout => 1 }
}
};
#+END_SRC
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment