X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=grading%2Fuserprog%2Frun-tests;h=8104a7f307988b8d0ad193a8e597618b1f5b8d21;hb=01ed0d12695b730527020b3c6d1472a1a9358c96;hp=4f4bb100a55ae74d2788242bef6d753e9addb7a4;hpb=06aa2c0d714c83f0300559b48972bf454f3dab56;p=pintos-anon diff --git a/grading/userprog/run-tests b/grading/userprog/run-tests index 4f4bb10..8104a7f 100755 --- a/grading/userprog/run-tests +++ b/grading/userprog/run-tests @@ -1,5 +1,15 @@ #! /usr/bin/perl +# Find the directory that contains the grading files. +our ($GRADES_DIR); + +# Add our Perl library directory to the include path. +BEGIN { + ($GRADES_DIR = $0) =~ s#/[^/]+$##; + -d $GRADES_DIR or die "$GRADES_DIR: stat: $!\n"; + unshift @INC, "$GRADES_DIR/../lib"; +} + use warnings; use strict; use POSIX; @@ -116,11 +126,6 @@ if ($grade) { exit 0; } -# Find the directory that contains the grading files. -our ($GRADES_DIR); -($GRADES_DIR = $0) =~ s#/[^/]+$##; --d $GRADES_DIR or die "$GRADES_DIR: stat: $!\n"; - if ($clean) { # Verify that we're roughly in the correct directory # before we go blasting away files.