Пример #1
0
	bool RunTest(const FString& Parameters) override
	{
		// find the matching test
		TestFunc TestFunction = nullptr;
		for (int32 i = 0; i < TestFunctionNames.Num(); ++i)
		{
			if (TestFunctionNames[i] == Parameters)
			{
				TestFunction = TestFunctions[i];
				break;
			}
		}
		if (TestFunction == nullptr)
		{
			return false;
		}

		// get the current curve and data table (to restore later)
		UCurveTable *CurveTable = IGameplayAbilitiesModule::Get().GetAbilitySystemGlobals()->GetGlobalCurveTable();
		UDataTable *DataTable = IGameplayAbilitiesModule::Get().GetAbilitySystemGlobals()->GetGlobalAttributeMetaDataTable();

		// setup required GameplayTags
		UDataTable* TagTable = CreateGameplayDataTable();

		IGameplayTagsModule::Get().GetGameplayTagsManager().PopulateTreeFromDataTable(TagTable);

		UWorld *World = UWorld::CreateWorld(EWorldType::Game, false);
		FWorldContext &WorldContext = GEngine->CreateNewWorldContext(EWorldType::Game);
		WorldContext.SetCurrentWorld(World);

		FURL URL;
		World->InitializeActorsForPlay(URL);
		World->BeginPlay();

		// run the matching test
		uint64 InitialFrameCounter = GFrameCounter;
		{
			GameplayEffectsTestSuite Tester(World, this);
			(Tester.*TestFunction)();
		}
		GFrameCounter = InitialFrameCounter;

		GEngine->DestroyWorldContext(World);
		World->DestroyWorld(false);

		IGameplayAbilitiesModule::Get().GetAbilitySystemGlobals()->AutomationTestOnly_SetGlobalCurveTable(CurveTable);
		IGameplayAbilitiesModule::Get().GetAbilitySystemGlobals()->AutomationTestOnly_SetGlobalAttributeDataTable(DataTable);
		return true;
	}
Пример #2
0
int main (int argc, const char * argv[])
{
    std::map<std::string,std::string> ReplacedUserVals;
    ReplacedUserVals["TABLE"] = "0,0,0,0,\n0,0,0,0,\n0,0,0,0,\n";
    ReplacedUserVals["SS_1"] = "1,1,1,1,\n1,1,1,1,\n1,1,1,1,\n";
    ReplacedUserVals["VAL"] = "2,2,2,2,\n2,2,2,2,\n2,2,2,2,\n";
    ReplacedUserVals["SS_2"] = "3,3,3,3,\n3,3,3,3,\n3,3,3,3,\n";
    ReplacedUserVals["VAL2"] = "4,4,4,4,\n4,4,4,4,\n4,4,4,4,\n";
    std::string filestring= "/Users/keithdunaway/TestTemplate.txt";
    std::string modelstring = StochHMM::slurpFile(filestring);
    //std::cout << modelstring << "\n";
    StochHMM::templates Tester(modelstring);
    std::string printmodelname = "START_SITE";
    std::string IDnumber = "001";
    
    std::string printablestring = Tester.getTemplate(printmodelname, IDnumber,ReplacedUserVals);
    
    std::cout << printablestring << "\n";
    return 0;
}
Пример #3
0
int main(int argc, char* argv[])
{
    Tester(argc, argv).run();

    std::cout << "Prerequiste: Redis server should run on localhost, default port" << std::endl;
}