From c36c4244a23fe365bd293b5ada8299a9143c373f Mon Sep 17 00:00:00 2001 From: toole1 <toole1@6fbd10e7-183d-0410-a318-cb416676e4f2> Date: Sat, 16 Jul 2011 01:18:43 +0000 Subject: [PATCH] jack git-svn-id: https://subversion.cs.illinois.edu/svn/cs225@3368 6fbd10e7-183d-0410-a318-cb416676e4f2 --- Makefile.runtests => Makefile.proxy | 2 +- config.ini | 6 +++--- monad.cpp | 8 ++++---- output.cpp | 2 +- output.h | 4 ++-- runtests.cpp => proxy.cpp | 16 +++++++-------- runtests.h => proxy.h | 30 ++++++++++++++--------------- unit_test.h | 4 ++-- 8 files changed, 36 insertions(+), 36 deletions(-) rename Makefile.runtests => Makefile.proxy (96%) rename runtests.cpp => proxy.cpp (98%) mode change 100644 => 100755 rename runtests.h => proxy.h (88%) mode change 100644 => 100755 diff --git a/Makefile.runtests b/Makefile.proxy similarity index 96% rename from Makefile.runtests rename to Makefile.proxy index 9a7610f..e52be4a 100644 --- a/Makefile.runtests +++ b/Makefile.proxy @@ -1,6 +1,6 @@ CC = g++ CFLAGS += -Wall -TESTEXE = runtests +TESTEXE = proxy TESTOBJS += $(TESTEXE).o util.o unit_tests.o output.o OPTIMIZE = off diff --git a/config.ini b/config.ini index f7e99a4..3381fea 100644 --- a/config.ini +++ b/config.ini @@ -5,12 +5,12 @@ :https://subversion.cs.illinois.edu/svn/cs225/ [Monad Files] -Makefile.runtests +Makefile.proxy memcheck.h output.cpp output.h -runtests.cpp -runtests.h +proxy.cpp +proxy.h unit_test.h valgrind.h diff --git a/monad.cpp b/monad.cpp index 5955c51..2442657 100755 --- a/monad.cpp +++ b/monad.cpp @@ -114,7 +114,7 @@ int main(int argc, char ** argv) output::header("Compiling"); chdir(gradeFolder.c_str()); - // #define MP_PART_NUMBER in runtests + // #define MP_PART_NUMBER in proxy ofstream mp_part_file; mp_part_file.open("_mp_part_number.h"); if (mp_part == no_mp_part) @@ -142,7 +142,7 @@ int main(int argc, char ** argv) // over config.ini. But students don't. cout << endl << endl; - int score = exec("./runtests"); + int score = exec("./proxy"); if (score < 0) { output::header("Running tests"); @@ -292,8 +292,8 @@ void monad::printHelp() << "; svn base url here (http://.../cs225/)" << endl << "[Monad Files]" << endl << "; Any files to be copied from monad ./ to ./ASSIGNMENT/ testing directory" << endl - << "; By default, runtests.cpp is used to run test cases:" << endl - << "runtests.cpp" << endl << endl + << "; By default, proxy.cpp is used to run test cases:" << endl + << "proxy.cpp" << endl << endl << "The following options are available for individual tests' ../ASSIGNMENT_tests/config.ini:" << endl << "[Required Files]" << endl << "; Any files that must be copied from the ../ASSIGNMENT directory" << endl diff --git a/output.cpp b/output.cpp index ff0421f..b96afcc 100644 --- a/output.cpp +++ b/output.cpp @@ -2,7 +2,7 @@ #include "output.h" #include "util.h" -using namespace runtests; +using namespace proxy; using namespace util; using std::cout; using std::cerr; diff --git a/output.h b/output.h index d2e0fa2..fc128a9 100644 --- a/output.h +++ b/output.h @@ -9,9 +9,9 @@ namespace output void header(const std::string & title); void total_score(int32_t score); -void testname(const runtests::unit_test & curr_test, int32_t max_testname_len, int32_t max_points_len); +void testname(const proxy::unit_test & curr_test, int32_t max_testname_len, int32_t max_points_len); void warning(const std::string & message); -void detailed_info(const runtests::unit_test & curr_test); +void detailed_info(const proxy::unit_test & curr_test); } // namespace output diff --git a/runtests.cpp b/proxy.cpp old mode 100644 new mode 100755 similarity index 98% rename from runtests.cpp rename to proxy.cpp index 57f5a44..ab2b06f --- a/runtests.cpp +++ b/proxy.cpp @@ -1,4 +1,4 @@ -// runtests.cpp +// proxy.cpp // NOTE: This is a generic file. Actual unit tests are located in // unit_tests.cpp. // By Jack Toole for CS 225 spring 2011 @@ -19,7 +19,7 @@ #include "memcheck.h" #include "output.h" #include "pipestream.h" -#include "runtests.h" +#include "proxy.h" #include "util.h" #include "valgrind.h" @@ -30,7 +30,7 @@ using std::pair; using namespace util; using namespace output; -namespace runtests +namespace proxy { vector<unit_test> * global_tests = NULL; output_check_map * global_output_checks = NULL; @@ -52,7 +52,7 @@ OUTPUT_CHECK(contains) int main(int argc, char ** argv) { - using namespace runtests; + using namespace proxy; // Set up run-time environment RunTimeEnvironment env(global_tests, global_output_checks); @@ -65,7 +65,7 @@ int main(int argc, char ** argv) } -namespace runtests { +namespace proxy { int8_t RunTimeEnvironment::singleton = 0; @@ -432,7 +432,7 @@ bool UnitTestContainer::execute(bool enable_valgrind_call) // Unfortunately necessary to use a return stack instead of // exit() to get rid of valgrind errors - // (which is important if we use valgrind ./runtests recursively) + // (which is important if we use valgrind ./proxy recursively) return false; // previously exit(0); } else if (pid < 0) @@ -501,7 +501,7 @@ bool UnitTestContainer::execute(bool enable_valgrind_call) void UnitTestContainer::child_valgrind() { start_timeout(); - execl("/usr/bin/valgrind", "/usr/bin/valgrind", "--trace-children=yes", /*"--log-fd=-1",*/ "-q", "./runtests", test.name, NULL); + execl("/usr/bin/valgrind", "/usr/bin/valgrind", "--trace-children=yes", /*"--log-fd=-1",*/ "-q", "./proxy", test.name, NULL); // Execl failed cerr << "valgrind execute failed" << endl; @@ -691,5 +691,5 @@ UnitTestContainer::UnitTestContainer(unit_test & _test, RunTimeEnvironment & env -} // namespace runtests +} // namespace proxy diff --git a/runtests.h b/proxy.h old mode 100644 new mode 100755 similarity index 88% rename from runtests.h rename to proxy.h index f2ac2fb..a07fa42 --- a/runtests.h +++ b/proxy.h @@ -1,4 +1,4 @@ -// runtests.h +// proxy.h // NOTE: This is a generic file. Actual unit tests are located in // unit_tests.cpp. // By Jack Toole for CS 225 spring 2011 @@ -18,7 +18,7 @@ #include "_mp_part_number.h" #define MP_PART(x) (MP_PART_NUMBER == (x) || MP_PART_NUMBER == NO_MP_PART) -namespace runtests +namespace proxy { class RunTests; struct unit_test; @@ -142,33 +142,33 @@ namespace runtests unsigned long d = 0, unsigned long e = 0); bool bitflag(int32_t flags, int32_t num); -} // namespace runtests +} // namespace proxy using std::cout; using std::cerr; using std::endl; #define UNIT_TEST(MPpart,func,pointsInPart,pointsInTotal,timeout) \ - runtests::unit_test::return_type \ - func(runtests::unit_test & this_test); \ - runtests::add_unit_test \ + proxy::unit_test::return_type \ + func(proxy::unit_test & this_test); \ + proxy::add_unit_test \ func##_adder(MPpart, #func, func, pointsInPart, \ pointsInTotal, timeout, false); \ - runtests::unit_test::return_type \ - func(runtests::unit_test & this_test) + proxy::unit_test::return_type \ + func(proxy::unit_test & this_test) #define VALGRIND_TEST(MPpart,func,pointsInPart,pointsInTotal,timeout) \ - runtests::unit_test::return_type \ - func(runtests::unit_test & this_test); \ - runtests::add_unit_test \ + proxy::unit_test::return_type \ + func(proxy::unit_test & this_test); \ + proxy::add_unit_test \ func##_adder(MPpart, #func, func, pointsInPart, \ pointsInTotal, timeout, true); \ - runtests::unit_test::return_type \ - func(runtests::unit_test & this_test) + proxy::unit_test::return_type \ + func(proxy::unit_test & this_test) #define OUTPUT_CHECK(func) \ bool output_check_##func(const std::string & output, const std::string & expected); \ - runtests::add_output_check \ + proxy::add_output_check \ output_check_##func##_adder(#func, output_check_##func); \ bool output_check_##func(const std::string & output, const std::string & expected) @@ -185,7 +185,7 @@ using std::endl; #define ASSERT_OUTPUT(checkFunc, str) \ *this_test.checkstream << #checkFunc << str; -namespace runtests { +namespace proxy { inline int32_t bitflags(unsigned long a, unsigned long b, unsigned long c, unsigned long d, unsigned long e) diff --git a/unit_test.h b/unit_test.h index 142cd48..13e1d24 100644 --- a/unit_test.h +++ b/unit_test.h @@ -4,7 +4,7 @@ #include <string> #include "pipestream.h" -namespace runtests +namespace proxy { class RunTests; @@ -32,7 +32,7 @@ namespace runtests int32_t points_, long timeout_, bool is_valgrind_) - : errormsg("message not set / runtests crashed"), + : errormsg("message not set / proxy crashed"), func(func_), name(name_), checkstream(NULL), -- GitLab