void TestPath::insert( Test *test, int index ) { if ( index < 0 || index > getTestCount() ) throw std::out_of_range( "TestPath::insert(): index out of range" ); m_tests.insert( m_tests.begin() + index, test ); }
/*! * @brief Returns the index of the test with the specified name. * * @param[in] name - name of the desired test * @return - returns the index of the test if found, -1 otherwise * * @author J. Peterson * @date 06/22/2014 */ int CTestScript::findTestByName(QString &name) { int testCount = getTestCount(); for (int i=0; i<testCount; i++) { QString *pStr = getTestName(i); if (name == *pStr) return(i); } return(-1); }
std::string TestPath::toString() const { std::string asString( "/" ); for ( int index =0; index < getTestCount(); ++index ) { if ( index > 0 ) asString += '/'; asString += getTestAt(index)->getName(); } return asString; }
string Testing::getTestPercentage() { int nRunTests = runTests.size(); string str = estr + "(" + nRunTests + "/" + getTestCount() + ") test"; if (nRunTests != 1) str += "s"; return str; }
void Testing::runAllTests() { println(createLine("=")); pln(estr + "RUNNING ALL TESTS (" + testcases.size() + " testfiles with " + testCountToString(getTestCount()) + ")") vector<string> keys; for (auto entry : testcases) { keys.push_back(entry.first); } auto cmp = [](String a, String b) { a = a.toLower(); b = b.toLower(); return a.compare(b) < 0; }; sort(keys.begin(),keys.end(), cmp); for (auto key : keys) { runTestfile(key); } printStatistic(); }
void test::onOkButtonOnClick() { emit okTest(getLedHight(),getLedLow(),getLedSymbol(),getPmwDirection(),getPmwEnable(),getPmwHz(),getSpiSymbol(),getSwdr(),getbindi(),getTestCount()); this->close(); }
bool TestPath::isValid() const { return getTestCount() > 0; }
void TestPath::checkIndexValid( int index ) const { if ( index < 0 || index >= getTestCount() ) throw std::out_of_range( "TestPath::checkIndexValid(): index out of range" ); }
Test * TestPath::getChildTest() const { return getTestAt( getTestCount() -1 ); }
void TestPath::up() { checkIndexValid( 0 ); removeTest( getTestCount() -1 ); }