X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=grading%2Flib%2FPintos%2FGrading.pm;h=860720c0750e3bf5e6a526e431bbb9cad04c56c8;hb=c9933c8af7ba2af6aaccf381471bc757d78ce6b2;hp=c2072a4f1c4714eb85a5f00e168f259c9698f4b5;hpb=6e37e2d09df0c11d77e0516cbc03c850eb72b8da;p=pintos-anon diff --git a/grading/lib/Pintos/Grading.pm b/grading/lib/Pintos/Grading.pm index c2072a4..860720c 100644 --- a/grading/lib/Pintos/Grading.pm +++ b/grading/lib/Pintos/Grading.pm @@ -345,12 +345,9 @@ sub xsystem { print "Child terminated with signal $signal\n"; } - my ($exp_status) = !defined ($options{EXPECT}) ? 0 : $options{EXPECT}; - $result = WIFEXITED ($status) && WEXITSTATUS ($status) == $exp_status - ? "ok" : "error"; + $result = $status == 0 ? "ok" : "error"; } - if ($result eq 'error' && defined $options{DIE}) { my ($msg) = $options{DIE}; if (defined ($log)) { @@ -402,7 +399,6 @@ sub get_test_result { sub run_pintos { my ($cmd_line, %args) = @_; - $args{EXPECT} = 1 unless defined $args{EXPECT}; my ($retval) = xsystem ($cmd_line, %args); return 'ok' if $retval eq 'ok'; return "Timed out after $args{TIMEOUT} seconds" if $retval eq 'timeout'; @@ -832,5 +828,12 @@ sub file_contains { close (FILE); return $equal; } + +sub success { + for my $test (@TESTS) { + return 1 if !defined ($result{$test}) || $result{$test} ne 'ok'; + } + return 0; +} 1;