From cf321533619302caa09428b78e8cfb4a17f6bb3f Mon Sep 17 00:00:00 2001
From: toole1 <toole1@6fbd10e7-183d-0410-a318-cb416676e4f2>
Date: Wed, 17 Aug 2011 22:24:59 +0000
Subject: [PATCH] jack autograder work

git-svn-id: https://subversion.cs.illinois.edu/svn/cs225@3395 6fbd10e7-183d-0410-a318-cb416676e4f2
---
 TODO.txt         | 17 +++++++++--------
 monad.cpp        |  2 ++
 monad_shared.cpp |  7 +++++++
 monad_shared.h   |  1 +
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/TODO.txt b/TODO.txt
index 737cad7..00c67b8 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -37,18 +37,20 @@ Critical
     x EasyBMP shouldn't be taken from student's folder
       SSH for security
       /dev/shm
-   better output on student idiocy
-    x on crazy memory errors, glibc issues, valgrind aborts
-    x fix "" failure messages
-      if compilation fails
+   better output
+     personification
+     quotes of the day
+     man isatty - colors when terminal
+     better output on student idiocy
+      x on crazy memory errors, glibc issues, valgrind aborts
+      x fix "" failure messages
+        if compilation fails
    STYLE
    Directory structure for config.ini includes
-   setenv("PATH"...) to safe path and use execlp
    encrypt/secure pipe transfers
    readFile() bug where lines have ':' or '?' in them?!
-   quotes of the day
-   personification
  x safer cross-platform exec()
+    x setenv("PATH"...) to safe path and use execlp
 
 Moderately important
 ---------------------
@@ -62,7 +64,6 @@ Moderately important
    fix sigalarm security hole
    optimization
    replace ln -s util/* system() calls
-   man isatty
    mp1_newtests and lab02_newtests currently have 2 different ways of compiling 2 programs. this should be unified
 
 Doesn't really matter
diff --git a/monad.cpp b/monad.cpp
index 48fa6e3..4a13484 100755
--- a/monad.cpp
+++ b/monad.cpp
@@ -79,6 +79,7 @@ int main(int argc, char ** argv)
 	// Find monad/ directory
 	find_base_dir(argv[0]);
 
+
 	// Read in local config settings.
 	// Necessary to do this early for [SVN Root] url
 	readConfig("./", config);
@@ -88,6 +89,7 @@ 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)
diff --git a/monad_shared.cpp b/monad_shared.cpp
index fe7ce82..eb9a908 100755
--- a/monad_shared.cpp
+++ b/monad_shared.cpp
@@ -38,6 +38,13 @@ void printInfo()
 namespace output
 {
 
+// Set EXIT_IF_ERROR message
+void set_error_message()
+{
+	SET_ERROR_MESSAGE("Oops! Something went wrong inside of me.\n"
+		"Please contact course staff with the following error details, and they'll figure it out:\n");
+}
+
 void header(const string & title)
 {
 	cout << title << "..." << endl
diff --git a/monad_shared.h b/monad_shared.h
index d2c0980..78236b0 100755
--- a/monad_shared.h
+++ b/monad_shared.h
@@ -59,6 +59,7 @@ namespace monad_shared
 
 	namespace output
 	{
+		void set_error_message();
 		void header(const std::string & title);
 		void total_score(int32_t score);
 		void warning(const std::string & message);
-- 
GitLab