From 43d27907eb8db9982098450e6b751628e54f7435 Mon Sep 17 00:00:00 2001 From: toole1 <toole1@6fbd10e7-183d-0410-a318-cb416676e4f2> Date: Wed, 17 Aug 2011 23:49:56 +0000 Subject: [PATCH] jack autograder work git-svn-id: https://subversion.cs.illinois.edu/svn/cs225@3397 6fbd10e7-183d-0410-a318-cb416676e4f2 --- TODO.txt | 8 +++++++- monad.cpp | 10 +++++++--- proxy.cpp | 3 +++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/TODO.txt b/TODO.txt index 00c67b8..7d351e1 100644 --- a/TODO.txt +++ b/TODO.txt @@ -44,6 +44,7 @@ Critical better output on student idiocy x on crazy memory errors, glibc issues, valgrind aborts x fix "" failure messages + x on EXIT_IF_ERROR crashes if compilation fails STYLE Directory structure for config.ini includes @@ -51,6 +52,9 @@ Critical readFile() bug where lines have ':' or '?' in them?! x safer cross-platform exec() x setenv("PATH"...) to safe path and use execlp + remove all system() calls + fix make system() call in monad.cpp - need some varargs or something + replace ln -s util/* system() calls Moderately important --------------------- @@ -63,8 +67,9 @@ Moderately important x add mechanisms for custom output checks fix sigalarm security hole optimization - replace ln -s util/* system() calls mp1_newtests and lab02_newtests currently have 2 different ways of compiling 2 programs. this should be unified + more elegant way of handling mp4's Makefile.1 for part 1 in config.ini + possibly have the MP part number be defined when calling make and handle it internally. Doesn't really matter --------------------- @@ -73,3 +78,4 @@ Doesn't really matter fix unknown times, maybe only output timeout remove additional output under valgrind + diff --git a/monad.cpp b/monad.cpp index 4a13484..9d8da77 100755 --- a/monad.cpp +++ b/monad.cpp @@ -76,10 +76,11 @@ int main(int argc, char ** argv) { using namespace monad; + output::set_error_message(); + // Find monad/ directory find_base_dir(argv[0]); - // Read in local config settings. // Necessary to do this early for [SVN Root] url readConfig("./", config); @@ -89,7 +90,6 @@ int main(int argc, char ** argv) cout << "Testing " << name << "..." << endl << endl; cout << "Setting up test environment..." << endl; - output::set_error_message(); // Read in test-specific config settings if (mp_part == no_mp_part) @@ -123,7 +123,7 @@ int main(int argc, char ** argv) for (size_t i = 0; i < processing_commands.size(); i++) exec_command(processing_commands[i]); - string makestr = "/usr/bin/make --warn-undefined-variables"; + string makestr = "/usr/bin/make --quiet --warn-undefined-variables"; if (opts::optimize) makestr += " OPTIMIZE=on"; if (!config["Make Options"].empty()) @@ -135,6 +135,10 @@ int main(int argc, char ** argv) // Compile with make system(makestr.c_str()); // yes, system is insecure if the user has control // over config.ini. But students don't. + // TODO (toole1): Yeah but this leaves us open to + // aliasing issues, or forces us to specify make's + // path. Ugly either way. + // TODO exec("make", "--quiet", "--warn-undefined-variables", cout << endl << endl; int score = exec("./proxy"); diff --git a/proxy.cpp b/proxy.cpp index 5cd4e05..9e2506a 100755 --- a/proxy.cpp +++ b/proxy.cpp @@ -53,6 +53,9 @@ int main(int argc, char ** argv) { using namespace proxy; + // set up EXIT_IF_ERROR messages + output::set_error_message(); + // Set up run-time environment RunTimeEnvironment env(global_tests, global_output_checks); -- GitLab