Skip to content
Snippets Groups Projects
Commit f1d61e67 authored by toole1's avatar toole1
Browse files

or this

git-svn-id: https://subversion.cs.illinois.edu/svn/cs225@3379 6fbd10e7-183d-0410-a318-cb416676e4f2
parent 9f91e1cb
No related branches found
No related tags found
No related merge requests found
......@@ -238,7 +238,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 = UnitTestContainer(curr_test, environment).execute(false);
bool is_parent_process = execute_test(curr_test, environment, false);
if (!is_parent_process)
return environment.cleanup_globals();
......@@ -289,7 +289,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 = UnitTestContainer(curr_test, environment).execute(true);
bool is_parent_process = execute_test(curr_test, environment, 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
......@@ -458,7 +458,7 @@ void test_execution::aborted_exit()
}
bool UnitTestContainer::execute(bool enable_valgrind_call)
bool RunTests::execute_test(unit_test & _test, RunTimeEnvironment & environment, bool enable_valgrind_call)
{
cout << std::flush;
test_execution executor(test, environment, enable_valgrind_call);
......@@ -680,11 +680,5 @@ long test_execution::end_timeout()
UnitTestContainer::UnitTestContainer(unit_test & _test, RunTimeEnvironment & env)
: environment(env), test(_test) { }
} // namespace proxy
......@@ -106,26 +106,13 @@ namespace proxy
void output_detailed_info_if_any_failed(int32_t score);
void output_detailed_tests_info(int32_t score);
execute_test(unit_test & _test, RunTimeEnvironment & env, bool enable_valgrind_call);
private:
RunTests(const RunTests & other);
RunTests & operator=(const RunTests & other);
};
class UnitTestContainer
{
private:
RunTimeEnvironment & environment;
unit_test & test;
public:
UnitTestContainer(unit_test & _test, RunTimeEnvironment & env);
bool execute(bool enable_valgrind_call);
private:
UnitTestContainer(const UnitTestContainer & other);
UnitTestContainer & operator=(const UnitTestContainer & other);
};
template <typename F>
bool fork_execute(F & executor);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment