Ejemplo n.º 1
0
/* must be protected with a mutex */
int framework_main(enum benchmark_size_t size) {
  int score;
  memset(bench_info_list, 0, sizeof(bench_info_list));
  memset(bench_run_data, 0, sizeof(bench_run_data));

#ifdef ARRAYFILE
  arrayfile_stdout = arrayfile_fopen("arrayfile", "w");
  assert(arrayfile_stdout);
#endif

  if (size == kBenchmarkSmall) {
    SetupSmallBenchmarks();
  } else {
    SetupLargeBenchmarks();
  }

  fasta_10k_ref_output_len = strlen(fasta_10k_ref_output);

  printf("%d benchmarks registered\n", benchmark_count);
  RunAll();
  PrintScores();
  score = (int) GeometricMean();
#ifdef ARRAYFILE
  arrayfile_fclose(arrayfile_stdout);
  arrayfile_stdout = NULL;
#endif
  ClearBenchmarks();

   print_total_stats();
	
  printf("Aggregate score: %d\n", score);

  return score;
}
Ejemplo n.º 2
0
/**
 * Run the learner experiment
 */
void LearnerExperiment::run()
{
    for(int trials=0; trials<Config::instance()->root["Experiment"]["Trials"].asInt();++trials)
    {
        RunAll();
        // copy the data
        std::stringstream copyCmd;
        copyCmd << "cp ../resources/data/qT.dat ../resources/data/qT_" << trials
                << ".dat\n";
        system(copyCmd.str().c_str());
    }

}
// called by the framework to execute the tests for this unit test object.
// This function will call the virtual RunAll method provided in the UnitTestBase derived class.
// logger - reference to a Logger object used to log the results and diagnostic information
void UnitTestBase::RunAll( Logger & logger )
{
    m_pLogger = &logger;
    RunAll();
    m_pLogger = NULL;
}
Ejemplo n.º 4
0
/// Updates testing state
void CFeatureTestMgr::Update(float deltaTime)
{
	if (m_pendingLevelReload)
	{
		m_pendingLevelReload = false;
		m_hasQuickloaded = false;
		CryLogAlways("Reloading level before starting map tests.");
		gEnv->pConsole->ExecuteString("map");
		return;
	}

	if (m_pendingQuickload)
	{
		m_pendingQuickload = false;

		bool bAllowQuickload = true;

		if (gEnv->IsEditor())
		{
			ICVar* pg_allowSaveLoadInEditor = gEnv->pConsole->GetCVar("g_allowSaveLoadInEditor");
			const bool bAllowSaveInEditor = pg_allowSaveLoadInEditor && (pg_allowSaveLoadInEditor->GetIVal() != 0);
			if (!bAllowSaveInEditor)
			{
				CryLogAlways("Ignoring quickload tests in editor");
				bAllowQuickload = false;
			}
		}

		if (bAllowQuickload)
		{
			QuickloadReportResults();
			return;
		}
	}

	// WORKAROUND: Auto-tester sends run all request before FG tests have loaded, so we wait for them to register here
	if (m_pendingRunAll)
	{
		// Have any feature tests registered yet?
		if (!m_featureTests.empty())
		{
			// Initiate the RunAll!
			m_pendingRunAll = false;
			RunAll();
		}
	}

	// If running tests
	if (m_running)
	{
		// If a test is in progress
		if (m_pRunningTest)
		{
			m_pRunningTest->Update(deltaTime);
		}
		else	// We don't have a current test
		{
			// Get one from the scheduled list
			if (!StartNextTest() && !WaitingForScheduledTests())
			{
				CryLogAlways("Finished running map tests!");
			}
		}
	}
	else
	{
		//If we have tests scheduled but nothing is running, then wait for a time out

		if(WaitingForScheduledTests())
		{
			m_timeWaitedForScheduled += deltaTime;
			if(m_timeWaitedForScheduled >= m_timeoutScheduled)
			{
				m_waiting = false;
				CryLogAlways("More feature tests were scheduled, but exceeded wait time:%.2f!", m_timeoutScheduled);
			}
			else
			{
				//Try to start the next test again in case conditions are now met
				StartNextTest();
			}
		}
	}
}