// Standard
#include <string>
#include <fstream>
+#include <sstream>
+#include <cmath>
+
+#include <iostream>
// Project
#include <anna/xml/Compiler.hpp>
TestManager &testManager = TestManager::instantiate();
if (isFinished()) {
if (!testManager.getDumpReports()) return;
- std::string file = testManager.getReportsDirectory() + anna::functions::asString("/testcase.%llu.xml", a_id);
+ // report file name: cycle-<cycle id>.testcase-<test case id>.xml
+
+ // 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) {
a_steps.push_back(step);
}
+void TestCase::addCmd(const std::string &script, const std::string ¶meters) throw(anna::RuntimeException) {
+ assertInitialized();
+
+ TestStepCmd *step = new TestStepCmd(this);
+ step->setScript(script);
+ step->setParameters(parameters);
+
+ a_steps.push_back(step);
+}
+
TestStepWait *TestCase::searchNextWaitConditionFulfilled(const anna::DataBlock &message, bool waitFromEntity) throw() {
TestStepWait *result;