X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Ftesting%2FTestCase.cpp;h=d048dfc2284d47334001f7e1d8154816d5850196;hb=bfedf5aed2670ccd65405c0ff96539ccb88b8f23;hp=efaba5c3d02780c6c68477c7de96831aecf4e6d4;hpb=d723d5bf571eb48c641b092058eaa38bb6c4fcc8;p=anna.git diff --git a/source/testing/TestCase.cpp b/source/testing/TestCase.cpp index efaba5c..d048dfc 100644 --- a/source/testing/TestCase.cpp +++ b/source/testing/TestCase.cpp @@ -211,6 +211,12 @@ bool TestCase::reset(bool hard) throw() { // Soft reset if finished: if (!hard /* is soft reset */ && !isFinished()) return false; + // Dump as failed if still in progress (hard reset): + if (getState() == State::InProgress) { + addDebugSummaryHint("Testcase hard reset while in progress"); + setState(State::Failed); + } + // Clean stage //////////////////////////// // id is kept std::vector::iterator it; @@ -366,11 +372,25 @@ void TestCase::addWait(bool fromEntity, addStep(step); } -void TestCase::addWaitRegexp(bool fromEntity, const std::string ®exp) throw(anna::RuntimeException) { +void TestCase::addWaitRegexpHex(bool fromEntity, const std::string ®exp) throw(anna::RuntimeException) { + assertInitialized(); + + TestStepWait *step = new TestStepWait(this); + step->setConditionRegexpHex(fromEntity, regexp); + + LOGINFORMATION( + if (hasSameCondition(step->getCondition())) + anna::Logger::information(anna::functions::asString("The same wait condition has already been programmed in this test case (%llu). Are you sure ?", a_id), ANNA_FILE_LOCATION); + ); + + addStep(step); +} + +void TestCase::addWaitRegexpXml(bool fromEntity, const std::string ®exp) throw(anna::RuntimeException) { assertInitialized(); TestStepWait *step = new TestStepWait(this); - step->setCondition(fromEntity, regexp); + step->setConditionRegexpXml(fromEntity, regexp); LOGINFORMATION( if (hasSameCondition(step->getCondition()))