diff --git a/.monadid b/.monadid index f44065886597043dda118be0c0a13efa7a7734dc..9d868bdfc5c2e920abbbcde6953c465415f8446a 100644 --- a/.monadid +++ b/.monadid @@ -1,4 +1,4 @@ monad identification file This file is used for monad directory identification Built by toole1 on linux4.ews.illinois.edu -Build Date: Wed Sep 21 17:20:29 CDT 2011 +Build Date: Thu Sep 22 14:43:51 CDT 2011 diff --git a/Makefile b/Makefile index 70d0f53a0d24dfacc2338d8459490477e84815b8..1c77d3f6dcb8d3faba1c7672b90a63b0cd8a5250 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC = g++ -CFLAGS = -Wall +CFLAGS = -Wall -Wshadow EXENAME = monad OBJS = $(EXENAME).o help.o util.o monad_shared.o IDFILE = .monadid @@ -25,10 +25,15 @@ $(IDFILE): $(OBJS) $(EXENAME): $(OBJS) $(IDFILE) $(CC) $(CFLAGS) $(OBJS) -o $@ -help.cpp: $(wildcard *.h) README.cg +help.cpp: $(wildcard *.h) README.cg LICENSE.cg + +CONVERT_TXT_TO_CG=sed -e 's/"/\\"/g' -e 's/^/ << "/' -e 's/$$/" << endl/' README.cg: README.txt - sed -e 's/"/\\"/g' -e 's/^/ << "/' -e 's/$$/" << endl/' README.txt > README.cg + $(CONVERT_TXT_TO_CG) README.txt > README.cg + +LICENSE.cg: LICENSE.txt + $(CONVERT_TXT_TO_CG) LICENSE.txt > LICENSE.cg .cpp.o: $(wildcard *.h) $(CC) $(CFLAGS) -c $(@:.o=.cpp) -o $@ diff --git a/Makefile.proxy b/Makefile.proxy index de923a4899b4c8b2283a200e61fd981535296f24..cf6e16a8957529621b2af2792b043c298b4965e2 100644 --- a/Makefile.proxy +++ b/Makefile.proxy @@ -1,5 +1,5 @@ CC = g++ -CFLAGS += -Wall +CFLAGS += -Wall -Wshadow TESTEXE := proxy # This order is necessary for security. Always include student code last! TESTOBJS := $(TESTEXE).o util.o unit_tests.o monad_shared.o $(TESTOBJS) diff --git a/help.cpp b/help.cpp index ed535e6127f24d764c3606c17551b7231f371da6..c8e9266ff968ff690d63fee5e41c518d9e4f1d21 100644 --- a/help.cpp +++ b/help.cpp @@ -10,4 +10,11 @@ void printHelp() ; } +void printLicense() +{ + cout +#include "LICENSE.cg" + ; } + +} // namespace monad diff --git a/monad b/monad index 9a0b9156edda78a9229558dee2d109198ae153ef..dd28530d7aff33690fa64a0daec856c9702ffcd9 100755 Binary files a/monad and b/monad differ diff --git a/monad.h b/monad.h index dec4356398760e1f188c6a86b05e560422b0e02e..01237df7c53a5d5108fbbe4075372c7109d63dfc 100644 --- a/monad.h +++ b/monad.h @@ -23,6 +23,7 @@ namespace monad { void printHelp(); +void printLicense(); } diff --git a/proxy.cpp b/proxy.cpp index 2e4c764a80d46580de3b1d7cf54579a62db8b223..50932f0d66c6cc6ffa8c13fe4a39f8baaa8290b3 100755 --- a/proxy.cpp +++ b/proxy.cpp @@ -244,7 +244,7 @@ int32_t RunTests::run_single_test(unit_test & curr_test) cout << "Running " << curr_test.name << " [worth " << curr_test.points << " points, output below]" << endl; - bool is_parent_process = execute_test(curr_test, environment, false); + bool is_parent_process = execute_test(curr_test, false); if (!is_parent_process) return environment.cleanup_globals(); @@ -295,7 +295,7 @@ int RunTests::run_all_tests() unit_test & curr_test = tests[test_i]; output::testname(curr_test, max_testname_len, max_points_len); - bool is_parent_process = execute_test(curr_test, environment, true); + bool is_parent_process = execute_test(curr_test, true); // Check for the child process // This is unfortunately necessary (instead of an exit) to clean up // all the memory in use in main and the global space for valgrind @@ -460,7 +460,7 @@ void test_execution::after_failure(int8_t signal_number) } -bool RunTests::execute_test(unit_test & test, RunTimeEnvironment & environment, bool enable_valgrind_call) +bool RunTests::execute_test(unit_test & test, bool enable_valgrind_call) { cout << std::flush; test_execution executor(test, environment, enable_valgrind_call); diff --git a/proxy.h b/proxy.h index f23c240034fd3280b5d52bd80c15759a6eafac05..9440f2b114e777a80538e91e323bf04328d717ef 100755 --- a/proxy.h +++ b/proxy.h @@ -111,7 +111,7 @@ namespace proxy void output_detailed_info_if_any_failed(int32_t score); void output_detailed_tests_info(int32_t score); - bool execute_test(unit_test & test, RunTimeEnvironment & environment, bool enable_valgrind_call); + bool execute_test(unit_test & test, bool enable_valgrind_call); private: RunTests(const RunTests & other);