else if(param1 == "repeats") {
if (numParams > 2 || numParams < 2)
throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
-
- testManager.setPoolRepeats(atoi(param2.c_str()));
- int repeats = testManager.getPoolRepeats();
+ int repeats = atoi(param2.c_str());
+ if (repeats < 0) repeats = -1;
+ testManager.setPoolRepeats(repeats);
std::string nolimit = (repeats != -1) ? "":" [no limit]";
opt_response_content += anna::functions::asString("Pool repeats: %d%s (current cycle: %d)", repeats, nolimit.c_str(), testManager.getPoolCycle());
}
// Standard
#include <string>
#include <fstream>
+#include <sstream>
+#include <cmath>
+
+#include <iostream>
// Project
#include <anna/xml/Compiler.hpp>
if (isFinished()) {
if (!testManager.getDumpReports()) return;
// report file name: cycle-<cycle id>.testcase-<test case id>.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) {