Expect proper result from `pintos get'.
[pintos-anon] / grading / userprog / run-tests
index 3019d30c5d4a7dcacbcc5698f443a7dbb715c956..b10cb973ebe8c2d59c1d9f0f91a73bd6952d63c5 100755 (executable)
@@ -20,6 +20,14 @@ our ($test);
 our (%extra);
 our ($action);
 
+if ($#ARGV == 0 && $ARGV[0] eq 'null') {
+    @TESTS = ('null');
+    extract_sources ();
+    build ();
+    run_and_grade_tests ();
+    exit success ();
+}
+
 parse_cmd_line qw (args-argc args-argv0 args-argvn args-single args-multiple
                   args-dbl-space
                   sc-bad-sp sc-bad-arg sc-boundary
@@ -38,9 +46,6 @@ parse_cmd_line qw (args-argc args-argv0 args-argvn args-single args-multiple
                   join-simple join-twice join-killed join-bad-pid
                   multi-recurse multi-oom multi-child-fd);
 
-# Default set of tests.
-@TESTS =  unless @TESTS > 0;
-
 clean_dir (), exit if $action eq 'clean';
 
 extract_sources (); 
@@ -52,10 +57,10 @@ exit if $action eq 'build';
 run_and_grade_tests (); 
 write_grades (); 
 write_details ();
-exit if $action eq 'test';
+exit success () if $action eq 'test';
 
 assemble_final_grade ();
-exit if $action eq 'assemble';
+exit success () if $action eq 'assemble';
 
 die "Don't know how to '$action'";
 
@@ -165,7 +170,7 @@ sub get_file {
                               . "-v get $guest_fn $host_fn",
                               LOG => "$test/get-$guest_fn",
                               TIMEOUT => 10,
-                              EXPECT => 0);
+                              EXPECT => 1);
     die "`pintos get $guest_fn' failed - $result\n"
        if $result ne 'ok';
 }