projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
22e217e
)
Fix treatment of timeouts in run-tests and pintos.
author
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 23 Nov 2004 01:56:00 +0000
(
01:56
+0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 23 Nov 2004 01:56:00 +0000
(
01:56
+0000)
grading/vm/run-tests
patch
|
blob
|
history
diff --git
a/grading/vm/run-tests
b/grading/vm/run-tests
index 61adbaf2fdb8c5548d553e9c2198ab38c6d874a6..b6987fe000e012fc2eadfeaaa437794836d8d55f 100755
(executable)
--- a/
grading/vm/run-tests
+++ b/
grading/vm/run-tests
@@
-694,6
+694,8
@@
sub xsystem {
$status = $?;
alarm 0;
};
$status = $?;
alarm 0;
};
+
+ my ($ok);
if ($@) {
die unless $@ eq "alarm\n"; # propagate unexpected errors
print "Timed out: ";
if ($@) {
die unless $@ eq "alarm\n"; # propagate unexpected errors
print "Timed out: ";
@@
-705,21
+707,21
@@
sub xsystem {
print "Waiting for $pid to die" if $i == 0;
print ".";
}
print "Waiting for $pid to die" if $i == 0;
print ".";
}
- $status = 0;
- }
+ $ok = 1;
+ } else {
+ if (WIFSIGNALED ($status)) {
+ my ($signal) = WTERMSIG ($status);
+ die "Interrupted\n" if $signal == SIGINT;
+ print "Child terminated with signal $signal\n";
+ }
- if (WIFSIGNALED ($status)) {
- my ($signal) = WTERMSIG ($status);
- die "Interrupted\n" if $signal == SIGINT;
- print "Child terminated with signal $signal\n";
+ my ($exp_status) = !defined ($options{EXPECT}) ? 0 : $options{EXPECT};
+ $ok = WIFEXITED ($status) && WEXITSTATUS ($status) == $exp_status;
}
}
- my ($expected_exit) = !defined ($options{EXPECT}) ? 0 : $options{EXPECT};
- my ($ok) = WIFEXITED ($status) && WEXITSTATUS ($status) == $expected_exit;
-
unlink ("output/$log.err") if defined ($log) && $ok;
unlink ("output/$log.err") if defined ($log) && $ok;
- die $options{DIE} if
$status != 0
&& defined $options{DIE};
+ die $options{DIE} if
!$ok
&& defined $options{DIE};
return $ok;
}
return $ok;
}