Where can I add FAutomationTestFramework::Get().PreTestingEvent delegate?

Hi, I want to add FAutomationTestFramework::Get().PreTestingEvent delegate.
Then I can 'InUnitTest" bool flag on and off by PreTestingEvent/PostTestingEvent delegate.
IModuleInteface::StartupModule() is called before FEngineLoop::PreInit() → FAutomationTestFramework::RunSmokeTest().
But, I don’t know what code in ‘primary module’ is called before FAutomationTestFramework::RunSmokeTest().

  1. Is there any good or official way to know that some function is called by AutomationTestFramework or not?
  2. Where should I add PreTestingEvent / PostTestingEvent delegate?

Thanks.

  1. Create class which inherits from FDefaultGameModuleImpl.
  2. Set it as IMPLEMENT_PRIMARY_GAME_MODULE()
  3. In StartupModule(), call FAutomationTestFramework::Get().PreTestingEvent.AddRaw(this, XX);
  4. In ShutdownModule(), call FAutomationTestFramework::Get().PreTestingEvent.RemoveAll(this);
  5. In OnPreAutomationTesting(), do something to mocking.