| 392 | } |
| 393 | |
| 394 | Result configureTests(const Parameters& parameters, Workspace& workspace) |
| 395 | { |
| 396 | Project project = {TEST_PROJECT_NAME}; |
| 397 | project.setRootDirectory(parameters.directories.projectDirectory.view()); |
| 398 | |
| 399 | project.addPresetConfiguration(Configuration::Preset::Debug, parameters); |
| 400 | project.addPresetConfiguration(Configuration::Preset::Release, parameters); |
| 401 | project.addPresetConfiguration(Configuration::Preset::DebugCoverage, parameters); |
| 402 | project.configurations.back().coverage.excludeRegex = ".*\\/Tools.*|" |
| 403 | ".*\\Test.(cpp|h|c)|" |
| 404 | ".*\\test.(c|h)|" |
| 405 | ".*\\/Tests/.*\\.*|" |
| 406 | ".*\\/LibC\\+\\+.inl|" |
| 407 | ".*\\/Assert.h|" |
| 408 | ".*\\/PluginMacros.h|" |
| 409 | ".*\\/ProcessPosixFork.inl|" |
| 410 | ".*\\/EnvironmentTable.h|" |
| 411 | ".*\\/InitializerList.h|" |
| 412 | ".*\\/Reflection/.*\\.*|" |
| 413 | ".*\\/ContainersReflection/.*\\.*|" |
| 414 | ".*\\/SerializationBinary/.*\\.*|" |
| 415 | ".*\\/Extra/Deprecated/.*\\.*"; |
| 416 | if (parameters.platform == Platform::Linux) |
| 417 | { |
| 418 | project.addPresetConfiguration(Configuration::Preset::Debug, parameters, "DebugValgrind"); |
| 419 | project.configurations.back().compile.enableASAN = false; |
| 420 | project.configurations.back().link.enableASAN = false; |
| 421 | } |
| 422 | |
| 423 | configureSaneStrictNoStdCpp(project); |
| 424 | |
| 425 | project.addDefines({"SC_COMPILER_ENABLE_CONFIG=1", "SC_TOOLS_COMPILED_SEPARATELY=1"}); |
| 426 | SC_TRY(addCompiledLibraryRootDefine(project, parameters)); |
| 427 | project.addIncludePaths({ |
| 428 | ".", |
| 429 | "Tests/SCTest", |
| 430 | }); |
| 431 | |
| 432 | SC_TRY(addSaneCppLibraries(project, parameters, Libraries::Multiple)); |
| 433 | SC_TRY(project.addIncludePaths({parameters.directories.libraryDirectory.view()})); |
| 434 | addSaneCppDebugVisualizers(project, parameters); |
| 435 | project.addFiles("Tests/SCTest", "*.cpp"); |
| 436 | project.addFiles("Tests/SCTest", "*.h"); |
| 437 | project.addFiles("Tests/Libraries", "**.c*"); |
| 438 | project.addFiles("Tests/Libraries", "**.inl"); |
| 439 | project.removeFiles("Tests/Libraries/Await", "AwaitTest.cpp"); |
| 440 | project.removeFiles("Tests/Libraries/Build", "BuildTest.cpp"); |
| 441 | project.addFiles("Tests/Support", "**.cpp"); |
| 442 | project.addFiles("Tests/Tools", "**.cpp"); |
| 443 | project.addFiles("Tools", "SC-*.cpp"); |
| 444 | project.addFiles("Tools", "*.h"); |
| 445 | |
| 446 | if (not project.addExportLibraries({"Foundation", "Memory", "Strings", "Containers"})) |
| 447 | { |
| 448 | return Result::Error("Failed to configure exported SCTest libraries"); |
| 449 | } |
| 450 | project.link.preserveExportedSymbols = true; |
| 451 |
no test coverage detected