| 517 | } |
| 518 | |
| 519 | std::vector<Test> enumerateTests() |
| 520 | { |
| 521 | std::vector<Test> tests; |
| 522 | |
| 523 | for (auto& desc : getTestRegistry()) |
| 524 | { |
| 525 | Test test; |
| 526 | |
| 527 | test.suiteName = desc.path.filename().string(); |
| 528 | test.name = desc.name; |
| 529 | test.tags = desc.options.tags; |
| 530 | test.skipMessage = desc.options.skipMessage; |
| 531 | test.deviceType = Device::Type::Default; |
| 532 | test.cpuFunc = desc.cpuFunc; |
| 533 | test.gpuFunc = desc.gpuFunc; |
| 534 | |
| 535 | if (test.cpuFunc) |
| 536 | { |
| 537 | tests.push_back(test); |
| 538 | } |
| 539 | else if (test.gpuFunc) |
| 540 | { |
| 541 | #if FALCOR_HAS_D3D12 |
| 542 | if (desc.options.deviceTypes.empty() || desc.options.deviceTypes.count(Device::Type::D3D12)) |
| 543 | { |
| 544 | test.deviceType = Device::Type::D3D12; |
| 545 | test.name = fmt::format("{} (D3D12)", desc.name); |
| 546 | tests.push_back(test); |
| 547 | } |
| 548 | #endif |
| 549 | #if FALCOR_HAS_VULKAN |
| 550 | if (desc.options.deviceTypes.empty() || desc.options.deviceTypes.count(Device::Type::Vulkan)) |
| 551 | { |
| 552 | test.deviceType = Device::Type::Vulkan; |
| 553 | test.name = fmt::format("{} (Vulkan)", desc.name); |
| 554 | tests.push_back(test); |
| 555 | } |
| 556 | #endif |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | // Sort by suite name first, followed by test name. |
| 561 | std::sort( |
| 562 | tests.begin(), |
| 563 | tests.end(), |
| 564 | [](const Test& a, const Test& b) |
| 565 | { |
| 566 | if (a.suiteName == b.suiteName) |
| 567 | return a.name < b.name; |
| 568 | return a.suiteName < b.suiteName; |
| 569 | } |
| 570 | ); |
| 571 | |
| 572 | return tests; |
| 573 | } |
| 574 | |
| 575 | std::vector<Test> filterTests( |
| 576 | std::vector<Test> tests, |