Files
UnrealEngineUWP/Engine/Source/Programs/LowLevelTests/Tests/LowLevelTestsModule.cpp
chris constantinescu 054a91e666 Introduce global setup for the LowLevelTests project.
Motivation: CoreUObject, taskgraph and threads are global constructs and need to be initialized as such and are expensive to setup/teardown before/after multiple single tests.

Introduced --global-setup and --no-global-setup to control execution of global test setup.
Unit tests that rely heavily on mocking and are designed to run without any global context should use --no-global-setup

Other: Removed CoreTestFixture and applied minor fixes wherever things didn't make sense.
One particular CoreUObject test was converted but had always failed to run on non-desktop platforms. It needs to be addressed ASAP.

#preflight 625873c7e304a95465fc148e
#rb Devin.Doucette, Zousar.Shaker

[CL 19769262 by chris constantinescu in ue5-main branch]
2022-04-15 07:21:27 -04:00

32 lines
624 B
C++

#include "TestCommon/CoreUtilities.h"
#include "TestCommon/CoreUObjectUtilities.h"
#include "LowLevelTestModule.h"
#include "Modules/ModuleManager.h"
class FGlobalLLTModule : public ILowLevelTestsModule
{
public:
virtual void GlobalSetup() override;
virtual void GlobalTeardown() override;
};
IMPLEMENT_MODULE(FGlobalLLTModule, GlobalLowLevelTests);
void FGlobalLLTModule::GlobalSetup()
{
InitTaskGraph();
InitThreadPool(true);
#if WITH_COREUOBJECT
InitCoreUObject();
#endif
}
void FGlobalLLTModule::GlobalTeardown()
{
#if WITH_COREUOBJECT
CleanupCoreUObject();
#endif
CleanupThreadPool();
CleanupTaskGraph();
}