59 ossLine0 <<
"# Simulation Number " << simInfo->getSimulationID() <<
" of " << simInfo->getNumberOfSimulations();
60 int length = 49 -
ossLine0.str().size();
61 ossLine0 << std::setfill(
' ') << std::right << std::setw(length) <<
"#";
64 ossLine1 <<
"# Kernel: " << std::setfill(
' ') << std::left << std::setw(38) << simInfo->getKernelName() <<
"#";
67 ossLine2 <<
"# Viscosity: " << std::setfill(
' ') << std::left << std::setw(35) << simInfo->getViscosity() <<
"#";
70 ossLine3 <<
"# SIMULATION: " << std::setfill(
' ') << std::left << std::setw(34) << simInfo->getSimulationName() <<
"#";
73 ossLine4 << std::setfill(
' ') << std::left << std::setw(14) <<
"#" << std::setw(34) << simInfo->getSimulationParameterString() <<
"#";
76 ossLine5 <<
"# L: " << std::setfill(
' ') << std::left << std::setw(43) << simInfo->getLx() <<
"#";
83 ossLine6 <<
"# DATE: " << std::setfill(
'0') << std::setw(2) << nowLocal.tm_mday <<
"." << std::setw(2) << nowLocal.tm_mon + 1 <<
"." << nowLocal.tm_year + 1900 <<
" TIME: " << std::setw(2) << nowLocal.tm_hour <<
":" << std::setw(2) << nowLocal.tm_min <<
":" << std::setw(2) << nowLocal.tm_sec <<
"\t" <<
"\t#";
112 printTestEnd(status);
117 setColor(numberOfTests == numberOfPassedTest);
118 printTestPassed(numberOfTests, numberOfExecutedTest, numberOfPassedTest, numberOfFailedTest, numberOfErrorTest, numberOfNotExecutedTest);
124 setColor(numberOfTests == numberOfPassedTest);
126 printTestPassed(numberOfTests, numberOfExecutedTest, numberOfPassedTest, numberOfFailedTest, numberOfErrorTest, numberOfNotExecutedTest);
129void ColorConsoleOutputImp::printTestStart()
131 log(
"[-----------]");
136void ColorConsoleOutputImp::printTestEnd(
TestStatus status)
153 log(
"[-----------]");
156void ColorConsoleOutputImp::print(std::string output)
162void ColorConsoleOutputImp::printColor(std::string output)
164 log(
"[-----------] ");
168void ColorConsoleOutputImp::setColor(
TestStatus status)
172 case passed: color =
"green";
174 case failed: color =
"red";
185void ColorConsoleOutputImp::setColor(
bool passed)
193void ColorConsoleOutputImp::printTestPassed(
int numberOfTests,
int numberOfExecutedTest,
int numberOfPassedTest,
int numberOfFailedTest,
int numberOfErrorTest,
int numberOfNotExecutedTest)
195 std::ostringstream
test;
196 test <<
"[-----------]" << std::endl;
197 test <<
"[-----------] Test Summary" << std::endl;
198 test <<
"[-----------] " << numberOfTests <<
" initialized Tests" << std::endl;
199 test <<
"[-----------]" << std::endl;
200 test <<
"[-----------] " << numberOfExecutedTest <<
" out of " << numberOfTests <<
" Tests executed" << std::endl;
201 test <<
"[-----------] " << numberOfErrorTest <<
" out of " << numberOfTests <<
" Tests executed and completed with error" << std::endl;
202 test <<
"[-----------] " << numberOfNotExecutedTest <<
" out of " << numberOfTests <<
" Tests not executed" << std::endl;
203 test <<
"[-----------]" << std::endl;
204 test <<
"[-----------] " << numberOfPassedTest <<
" out of " << numberOfExecutedTest <<
" executed Tests passed" << std::endl;
205 test <<
"[-----------] " << numberOfFailedTest <<
" out of " << numberOfExecutedTest <<
" executed Tests failed" << std::endl;
206 test <<
"[-----------]" << std::endl;
210void ColorConsoleOutputImp::printLine()
212 log(
"----------------------------------------------------------------------");
215void ColorConsoleOutputImp::printGreen(std::string output)
220void ColorConsoleOutputImp::printGreenHashLine()
222 log(
"#################################################");
static std::shared_ptr< ColorConsoleOutput > getInstance()
void makeSimulationHeadOutput(std::shared_ptr< SimulationInfo > simInfo)
void makeFinalTestOutputHead(int numberOfTests, int numberOfExecutedTest, int numberOfPassedTest, int numberOfFailedTest, int numberOfErrorTest, int numberOfNotExecutedTest)
void makeTestOutput(std::vector< std::string > testOutput, TestStatus status)
void makeFinalTestOutputFoot(int numberOfTests, int numberOfExecutedTest, int numberOfPassedTest, int numberOfFailedTest, int numberOfErrorTest, int numberOfNotExecutedTest)
void log(const char *fmt)
std::shared_ptr< T > SPtr