\f
# Source tarballs.
-# Extracts the group's source files into pintos/src,
-# applies any patches providing in the grading directory,
-# and installs a default pintos/src/constants.h
+# Extracts the group's source files into pintos/src
+# and applies any patches providing in the grading directory.
sub extract_sources {
# Make sure the output dir exists.
-d ("output") || mkdir ("output") or die "output: mkdir: $!\n";
xsystem ("patch -fs -p0 < $patch",
LOG => $stem, DIE => "applying patch $stem failed\n");
}
-
- # Install default pintos/src/constants.h.
- open (CONSTANTS, ">pintos/src/constants.h")
- or die "constants.h: create: $!\n";
- print CONSTANTS "#define THREAD_JOIN_IMPLEMENTED 1\n";
- close CONSTANTS;
}
# Returns the name of the tarball to extract.
sub grade_test {
# Read test output.
my ($outfile) = "output/$test/run.out";
- die "$outfile: missing test output file (make failed?)" if ! -e $outfile;
+ if (! -e $outfile) {
+ if (-s "output/$test/make.err") {
+ # make failed.
+ $details{$test} = snarf ("output/$test/make.err");
+ return "make failed. Error messages at end of file.";
+ }
+ return "preparation for test failed";
+ }
my (@output) = snarf ($outfile);
# If there's a function "grade_$test", use it to evaluate the output.