X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestCase.cpp;h=a8b96433aebea6f816fcd1073793a23478f66f91;hb=a9bcabee38bedb9b3f2510d4f91b83f6c306b625;hp=b3d2f2f42e12f909f46f46fde68a44ea2f331d83;hpb=f9534159f3b43cbf74eccf88723ee740c69eb204;p=anna.git diff --git a/example/diameter/launcher/testing/TestCase.cpp b/example/diameter/launcher/testing/TestCase.cpp index b3d2f2f..a8b9643 100644 --- a/example/diameter/launcher/testing/TestCase.cpp +++ b/example/diameter/launcher/testing/TestCase.cpp @@ -9,6 +9,10 @@ // Standard #include #include +#include +#include + +#include // Project #include @@ -111,7 +115,17 @@ void TestCase::setState(const State::_v &state) throw() { if (isFinished()) { if (!testManager.getDumpReports()) return; // report file name: cycle-.testcase-.xml - std::string file = testManager.getReportsDirectory() + anna::functions::asString("/cycle-%d.testcase-%llu.xml", testManager.getPoolCycle(), a_id); + + // FORMAT: We tabulate the cycle and test case in order to ease ordering of files by mean ls: + int cycles = testManager.getPoolRepeats(); + int tests = testManager.tests(); + int cyclesWidth = (cycles<=0) ? 3 /* 1000 cycles !! */: ((int) log10 ((double) cycles) + 1); + int testsWidth = (tests<=0) ? 9 /* subscribers */: ((int) log10 ((double) tests) + 1); + std::stringstream format; + format << "/cycle-%0" << cyclesWidth << "d.testcase-%0" << testsWidth << "llu.xml"; + + // FILE NAME: + std::string file = testManager.getReportsDirectory() + anna::functions::asString(format.str().c_str(), testManager.getPoolCycle(), a_id); std::ofstream out; out.open(file.c_str(), std::ofstream::out | std::ofstream::app); if(out.is_open() == false) {