MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / main

Function main

tests/unit/engine/Poseidon/test_main.cpp:167–197  ·  view source on GitHub ↗

Minimal main for running Catch2 tests

Source from the content-addressed store, hash-verified

165
166// Minimal main for running Catch2 tests
167int main(int argc, char* argv[])
168{
169 SetEnvVar("POSEIDON_TEST", "1");
170 spdlog::default_logger()->set_level(spdlog::level::off);
171
172 // Set the global Poseidon::Foundation::AppFrameFunctions pointer (defined in Poseidon.lib)
173 Poseidon::Foundation::CurrentAppFrameFunctions = &testAppFrame;
174 SetMemorySystemReady(true);
175 Poseidon::Foundation::gSoftAssert = true; // don't break into debugger on non-fatal assertions
176 ScopedPoseidonTestPaths testPaths;
177 GamePaths::Instance().Initialize("CWR", "ColdWarAssault");
178 Poseidon::RegisterDummyAudioBackend();
179 Poseidon::RegisterTextAudioBackend();
180 Poseidon::RegisterOpenALAudioBackend();
181 Poseidon::RegisterOpenALVoiceBackend();
182
183 // Initialize ParamFile registration hooks
184 InitLibraryElement();
185 // Register Poseidon-layer default callback impls — overrides any
186 // SIOF clobber from cross-library static-init ordering. Matches
187 // what each production app calls from its own main().
188 Poseidon::InitDefaults();
189 GEngine = CreateEngineDummy();
190
191 // Create test application to provide GApp and configuration system
192 TestApplication testApp;
193
194 int result = Catch::Session().run(argc, argv);
195
196 return result;
197}

Callers

nothing calls this directly

Calls 12

SetEnvVarFunction · 0.85
RegisterTextAudioBackendFunction · 0.85
InitLibraryElementFunction · 0.85
InitDefaultsFunction · 0.85
CreateEngineDummyFunction · 0.85
SessionClass · 0.85
runMethod · 0.80
SetMemorySystemReadyFunction · 0.50
InitializeMethod · 0.45

Tested by

no test coverage detected