diff --git a/targets/tests/NumericalTests/Utilities/TestCout/TestCout.h b/targets/tests/NumericalTests/Utilities/TestCout/TestCout.h index f2d6179aa554a6cf40f31ff2829be5c7e859c2f6..7742a57d95071f2df56b417ad28cce688feca133 100644 --- a/targets/tests/NumericalTests/Utilities/TestCout/TestCout.h +++ b/targets/tests/NumericalTests/Utilities/TestCout/TestCout.h @@ -8,8 +8,8 @@ class TestCout public: virtual void makeTestOutput(bool testPassed, std::string testName, int l1, int l2, std::string nameWerte1, std::string nameWerte2, std::string nameWerte3, double testWert1, double testWert2, double testWert3) = 0; virtual void makeSimulationHeadOutput(std::string simName, int l) = 0; - virtual void makeFinalTestOutput(int numberOfPassedTests, int numberOfTests) = 0; - + virtual void makeFinalTestOutputHead(int numberOfPassedTests, int numberOfTests) = 0; + virtual void makeFinalTestOutputFoot(int numberOfPassedTests, int numberOfTests) = 0; private: }; #endif \ No newline at end of file diff --git a/targets/tests/NumericalTests/Utilities/TestCout/TestCoutImp.cpp b/targets/tests/NumericalTests/Utilities/TestCout/TestCoutImp.cpp index f700d664f677fa576eaab5fc86118a8e9fc038c2..b8a875728abb1e74704780e39cdb66e5af93bae8 100644 --- a/targets/tests/NumericalTests/Utilities/TestCout/TestCoutImp.cpp +++ b/targets/tests/NumericalTests/Utilities/TestCout/TestCoutImp.cpp @@ -55,17 +55,19 @@ void TestCoutImp::makeSimulationHeadOutput(std::string simName, int l) printGreenHashLine(); } -void TestCoutImp::makeFinalTestOutput(int numberOfPassedTests, int numberOfTests) +void TestCoutImp::makeFinalTestOutputFoot(int numberOfPassedTests, int numberOfTests) { setColor(numberOfPassedTests == numberOfTests); - testing::internal::ColoredPrintf(color, "[----------]\n[----------]"); - testing::internal::ColoredPrintf(testing::internal::COLOR_DEFAULT, "Test Summary\n"); - testing::internal::ColoredPrintf(color, "[----------]"); + printTestPassed(numberOfPassedTests, numberOfTests); + printLine(); +} - std::ostringstream info; - info << numberOfPassedTests << " out of " << numberOfTests << " tests passed"; - testing::internal::ColoredPrintf(testing::internal::COLOR_DEFAULT, info.str().c_str()); - testing::internal::ColoredPrintf(color, "\n[----------]\n\n"); +void TestCoutImp::makeFinalTestOutputHead(int numberOfPassedTests, int numberOfTests) +{ + setColor(numberOfPassedTests == numberOfTests); + printLine(); + printTestPassed(numberOfPassedTests, numberOfTests); + std::cout << std::endl; } void TestCoutImp::printTestStart() @@ -106,6 +108,21 @@ void TestCoutImp::setColor(bool testPassed) color = testing::internal::COLOR_RED; } +void TestCoutImp::printTestPassed(int numberOfPassedTests, int numberOfTests) +{ + std::ostringstream test; + test << "[----------]" << std::endl; + test << "[----------] Test Summary" << std::endl; + test << "[----------] " << numberOfPassedTests << " out of " << numberOfTests << " tests passed" << std::endl; + test << "[----------]" << std::endl; + testing::internal::ColoredPrintf(color, test.str().c_str()); +} + +void TestCoutImp::printLine() +{ + testing::internal::ColoredPrintf(color, "----------------------------------------------------------------------\n"); +} + void TestCoutImp::printGreen(std::string output) { testing::internal::ColoredPrintf(testing::internal::COLOR_GREEN, output.c_str()); diff --git a/targets/tests/NumericalTests/Utilities/TestCout/TestCoutImp.h b/targets/tests/NumericalTests/Utilities/TestCout/TestCoutImp.h index fffae40412cd19f66061bc740672cb0a24843594..12265a08159013ff67586394253e6d6317b4564c 100644 --- a/targets/tests/NumericalTests/Utilities/TestCout/TestCoutImp.h +++ b/targets/tests/NumericalTests/Utilities/TestCout/TestCoutImp.h @@ -35,7 +35,8 @@ public: void makeTestOutput(bool testPassed, std::string testName, int l1, int l2, std::string nameWerte1, std::string nameWerte2, std::string nameWerte3, double testWert1, double testWert2, double testWert3); void makeSimulationHeadOutput(std::string simName, int l); - void makeFinalTestOutput(int numberOfPassedTests, int numberOfTests); + void makeFinalTestOutputHead(int numberOfPassedTests, int numberOfTests); + void makeFinalTestOutputFoot(int numberOfPassedTests, int numberOfTests); private: TestCoutImp() {}; @@ -43,6 +44,8 @@ private: void printTestEnd(bool testPassed); void print(std::string output); void setColor(bool testPassed); + void printTestPassed(int numberOfPassedTests, int numberOfTests); + void printLine(); void printGreen(std::string output); void printGreenHashLine(); diff --git a/targets/tests/NumericalTests/Utilities/TestInformation/TestInformationImp.cpp b/targets/tests/NumericalTests/Utilities/TestInformation/TestInformationImp.cpp index 3ab12861df3e7251a7c74079ea53a677b1d188a1..f1bdd5333d463dfd2c32e2525dec3f69bbabfc68 100644 --- a/targets/tests/NumericalTests/Utilities/TestInformation/TestInformationImp.cpp +++ b/targets/tests/NumericalTests/Utilities/TestInformation/TestInformationImp.cpp @@ -44,11 +44,11 @@ void TestInformationImp::writeLogFile() void TestInformationImp::makeFinalTestOutput() { - colorOutput->makeFinalTestOutput(getNumberOfPassedTests(),getNumberOfTests()); + colorOutput->makeFinalTestOutputHead(getNumberOfPassedTests(),getNumberOfTests()); for (int i = 0; i < testResults.size(); i++) { testResults.at(i)->makeFinalOutput(); } - colorOutput->makeFinalTestOutput(getNumberOfPassedTests(), getNumberOfTests()); + colorOutput->makeFinalTestOutputFoot(getNumberOfPassedTests(), getNumberOfTests()); } void TestInformationImp::setLogFilePath(std::string aLogFilePath)