Example #1
0
int main(int argc, char** argv)
{
  PropertyConfigurator::doConfigure("log4cplus.properties");

  log4cplus::Logger logger = log4cplus::Logger::getInstance("");
  //LOG4CPLUS_INFO(logger, "Configured logger");

  data_dir = "test_data";
  out_dir = ".";
  cl_delta = 0.01;
  string test;
  for (int i = 1; i < argc; ++i)
  {
    if ((string)argv[i] == "--data")
    {
      data_dir = argv[i+1];
      ++i;
    }
    else if ((string)argv[i] == "--out")
    {
      out_dir = argv[i+1];
      ++i;
    }
    else if ((string)argv[i] == "--delta")
    {
      cl_delta = boost::lexical_cast<Number_type>(argv[i+1]);
      ++i;
    }
    else if ((string)argv[i] == "--test")
    {
      test = argv[i+1];
      test = test + "Test";
      ++i;
    }
  }

  TestResultStdErr result;
  if (test != "")
    TestRegistry::Instance().Run(result, test.c_str());
  else
  {
    TestRegistry::Instance().Run(result);
  }
  return (result.FailureCount());
}
Example #2
0
int main(int argc, char const *argv[])
{
	for( int i = 1; i < argc; i++ )
	{
		if( strncmp( argv[i], "--vutpp:", 8 ) == 0 )
		{
			std::string strVutppParam = argv[i] + 8;
			const size_t seperator = strVutppParam.find( ',' );
			if( seperator == std::string::npos )
				return -1;

			HANDLE readPipe, writePipe;
			sscanf( strVutppParam.substr( 0, seperator ).c_str(), "%d", &readPipe );
			sscanf( strVutppParam.substr( seperator+1 ).c_str(), "%d", &writePipe );

			char readBuffer[1024], writeBuffer[1024];

			DWORD dwSize = 0;
			strcpy( writeBuffer, "connect" );
			if( WriteFile( writePipe, writeBuffer, 1024, &dwSize, NULL ) == false || dwSize != 1024 )
				return -1;

			while( true )
			{
				if( ReadFile( readPipe, readBuffer, 1024, &dwSize, NULL ) == false || dwSize != 1024 )
					return -1;

				if( strncmp( readBuffer, "__VUTPP_FINISH__", 16 ) == 0 )
					break;

				const char* pSeperator = strchr( readBuffer, ',' );
				std::string suiteName( readBuffer, pSeperator - readBuffer ), testName( pSeperator+1 );
				testName += "Test";

				bool bRun = false;

				for( int testIndex = 0; testIndex < TestRegistry::Instance().TestCount(); testIndex++ )
				{
					Test* pTest = TestRegistry::Instance().Tests()[testIndex];
					if( strcmp( pTest->Name(), testName.c_str() ) == 0 )
					{
						VUTPP_Result testResult( writePipe );
						pTest->Run(testResult);

						strcpy( writeBuffer, "-1," );
						bRun = true;
						if( WriteFile( writePipe, writeBuffer, 1024, &dwSize, NULL ) == false || dwSize != 1024 )
							return -1;
					}
				}

				if( bRun == false )
				{
					sprintf( writeBuffer, "%d,,%s", -2, "can't find test" );
					if( WriteFile( writePipe, writeBuffer, 1024, &dwSize, NULL ) == false || dwSize != 1024 )
						return -1;
				}
			}

			return 0;
		}
	}

	VUTPP_Result testResult( 0 );
	TestResultStdErr result;
	TestRegistry::Instance().Run(testResult);
	return (result.FailureCount());
}
Example #3
0
int main()
{
    TestResultStdErr result;
    TestRegistry::Instance().Run(result);
    return (result.FailedCount());
}
int main()
{   
    TestResultStdErr result;
    TestRegistry::runAllTests(result);
    return (result.getFailureCount());
}