#!/usr/bin/env perl # -*- mode: Perl;-*- # Version 4.20.8 # See the file COPYING in the main distribution directory for copyright notice. unshift (@INC, '/home/ff/cs61b/grading-software/share/lib'); require "GradingBase.pl"; CmndLine ("", 1, 2); require "GradingCommon.pl"; require "TestingCommon.pl"; $assgn = shift; $log = shift; if (! AssignmentExists ($assgn)) { Fatal ("Assignment $assgn does not exist."); } if (! TestsExist ($assgn)) { Fatal ("Assignment $assgn has no tests."); } if ($log) { open (TESTLOG, ">$log") || Fatal ("Could not open log file $log: $!"); $handle = TESTLOG; } else { $handle = STDOUT; } Note ("Running tests for assignment $assgn, logging to " . ($log ? "$log." : "standard output.")); $result = RunTests ($assgn, ".", $handle); close ($log); if ($result) { exit(0); } else { exit(1); }