Exemple #1
0
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);
}
Exemple #3
0
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;
}
Exemple #4
0
string Testing::getTestPercentage() {
	int nRunTests = runTests.size();
	string str = estr + "(" + nRunTests + "/" + getTestCount() + ") test";
	if (nRunTests != 1) str += "s";
	return str;
}
Exemple #5
0
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();
}
Exemple #6
0
void test::onOkButtonOnClick()
{
    emit okTest(getLedHight(),getLedLow(),getLedSymbol(),getPmwDirection(),getPmwEnable(),getPmwHz(),getSpiSymbol(),getSwdr(),getbindi(),getTestCount());
    this->close();
}
Exemple #7
0
bool
TestPath::isValid() const
{
  return getTestCount() > 0;
}
Exemple #8
0
void
TestPath::checkIndexValid( int index ) const
{
  if ( index < 0  ||  index >= getTestCount() )
    throw std::out_of_range( "TestPath::checkIndexValid(): index out of range" );
}
Exemple #9
0
Test *
TestPath::getChildTest() const
{
  return getTestAt( getTestCount() -1 );
}
Exemple #10
0
void
TestPath::up()
{
  checkIndexValid( 0 );
  removeTest( getTestCount() -1 );
}