Minimal main for running Catch2 tests
| 165 | |
| 166 | // Minimal main for running Catch2 tests |
| 167 | int 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 | } |
nothing calls this directly
no test coverage detected