X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=grading%2Flib%2FPintos%2FGrading.pm;h=3ebeb223b6a7ee53f5b7c6f11e943c2010075156;hb=5d3c07d8b0aad51ade536e35f63267f5826524c5;hp=3411b637dc7ad69a8096afe25755b672bcf56d0c;hpb=aa611970d5cbcfd5b0170c03effd74c2cab05708;p=pintos-anon diff --git a/grading/lib/Pintos/Grading.pm b/grading/lib/Pintos/Grading.pm index 3411b63..3ebeb22 100644 --- a/grading/lib/Pintos/Grading.pm +++ b/grading/lib/Pintos/Grading.pm @@ -19,14 +19,14 @@ use Algorithm::Diff; sub parse_cmd_line { GetOptions ("v|verbose+" => \$verbose, "h|help" => sub { usage (0) }, - "T|tests=s" => \@TESTS, + "tests=s" => \@TESTS, "c|clean" => sub { set_action ('clean'); }, "x|extract" => sub { set_action ('extract'); }, "b|build" => sub { set_action ('build'); }, "t|test" => sub { set_action ('test'); }, "a|assemble" => sub { set_action ('assemble'); }) or die "Malformed command line; use --help for help.\n"; - die "Non-option argument not supported; use --help for help.\n" + die "Non-option arguments not supported; use --help for help.\n" if @ARGV > 0; @TESTS = split(/,/, join (',', @TESTS)) if defined @TESTS; @@ -70,7 +70,7 @@ Workflow: Options: -c, --clean Delete test results and temporary files, then exit. - -T, --tests=TESTS Run only the specified comma-separated tests. + --tests=TESTS Run only the specified comma-separated tests. -x, --extract Stop after step 1. -b, --build Stop after step 2. -t, --test Stop after step 3 (default if "review.txt" not present). @@ -87,11 +87,12 @@ EOF # applies any patches providing in the grading directory, # and installs a default pintos/src/constants.h sub extract_sources { - # Nothing to do if we already have a source tree. - return if -d "pintos"; - + # Make sure the output dir exists. -d ("output") || mkdir ("output") or die "output: mkdir: $!\n"; + # Nothing else to do if we already have a source tree. + return if -d "pintos"; + my ($tarball) = choose_tarball (); # Extract sources. @@ -185,7 +186,7 @@ sub run_and_grade_tests { if $grade eq 'ok' && defined $details{$test}; print "$msg\n"; - $result{$test} = $result; + $result{$test} = $grade; } } @@ -539,7 +540,7 @@ sub look_for_panic { } my ($kernel_o); if ($hw eq 'threads') { - $kernel_o = "pintos/src/filesys/build/kernel.o"; + $kernel_o = "output/$test/kernel.o"; } else { $kernel_o = "pintos/src/$hw/build/kernel.o"; }