ribi::cmap::Node ribi::cmap::NodeFactory::GetTest(const int i) const noexcept
{
  const auto tests = GetTests();
  assert(i >= 0);
  assert(i < static_cast<int>(tests.size()));
  return tests[i];
}
void FAutomationTestBase::GenerateTestNames(TArray<FAutomationTestInfo>& TestInfo) const
{
	TArray<FString> BeautifiedNames;
	TArray<FString> ParameterNames;
	GetTests(BeautifiedNames, ParameterNames);

	FString BeautifiedTestName = GetBeautifiedTestName();

	for (int32 ParameterIndex = 0; ParameterIndex < ParameterNames.Num(); ++ParameterIndex)
	{
		FString CompleteBeautifiedNames = BeautifiedTestName;
		FString CompleteTestName = TestName;

		if (ParameterNames[ParameterIndex].Len())
		{
			CompleteBeautifiedNames = FString::Printf(TEXT("%s.%s"), *BeautifiedTestName, *BeautifiedNames[ParameterIndex]);;
			CompleteTestName = FString::Printf(TEXT("%s %s"), *TestName, *ParameterNames[ParameterIndex]);
		}

		// Add the test info to our collection
		FAutomationTestInfo NewTestInfo(
			CompleteBeautifiedNames,
			CompleteTestName,
			GetTestFlags(),
			GetRequiredDeviceNum(),
			ParameterNames[ParameterIndex],
			GetTestSourceFileName(),
			GetTestSourceFileLine(),
			GetTestAssetPath(ParameterNames[ParameterIndex]),
			GetTestOpenCommand(ParameterNames[ParameterIndex])
		);
		
		TestInfo.Add( NewTestInfo );
	}
}
ribi::cmap::Edge ribi::cmap::EdgeFactory::GetTest(
  const int index
) const noexcept
{
  //Nodes may be similar, but not the same
  const auto v = GetTests();
  assert(index >= 0);
  assert(index < static_cast<int>(v.size()));
  return v[index];
}
Esempio n. 4
0
void FAutomationTestBase::GenerateTestNames(TArray<FAutomationTestInfo>& TestInfo) const
{
    TArray<FString> BeautifiedNames;
    TArray<FString> ParameterNames;
    GetTests(BeautifiedNames, ParameterNames);

    FString BeautifiedTestName = GetBeautifiedTestName();

    for (int32 ParameterIndex = 0; ParameterIndex < ParameterNames.Num(); ++ParameterIndex)
    {
        FString CompleteBeautifiedNames = BeautifiedTestName;
        FString CompleteTestName = TestName;

        if (ParameterNames[ParameterIndex].Len())
        {
            CompleteBeautifiedNames = FString::Printf(TEXT("%s.%s"), *BeautifiedTestName, *BeautifiedNames[ParameterIndex]);;
            CompleteTestName = FString::Printf(TEXT("%s %s"), *TestName, *ParameterNames[ParameterIndex]);
        }

        // Set the test type
        uint8 TestType = EAutomationTestType::ATT_NormalTest;

        if (bComplexTask)
        {
            TestType = EAutomationTestType::ATT_StressTest;
        }
        else if(GetTestFlags() & EAutomationTestFlags::ATF_SmokeTest)
        {
            TestType = EAutomationTestType::ATT_SmokeTest;
        }

        // Add the test info to our collection
        FAutomationTestInfo NewTestInfo( CompleteBeautifiedNames, CompleteTestName, TestType, GetRequiredDeviceNum(), ParameterNames[ParameterIndex] );

        TestInfo.Add( NewTestInfo );
    }
}
int ribi::cmap::NodeFactory::GetNumberOfTests() const noexcept
{
  return static_cast<int>(GetTests().size());
}
const boost::shared_ptr<ribi::cmap::Examples> ribi::cmap::ExamplesFactory::GetTest(const int i) const noexcept
{
  assert(i >= 0);
  assert(i < GetNumberOfTests());
  return GetTests()[i];
}