namespace SC
| 550 | |
| 551 | } // namespace SC |
| 552 | SC::TestReport::TestReport(IOutput& console, int argc, const char** argv) : console(console) |
| 553 | { |
| 554 | #if SC_COMPILER_MSVC |
| 555 | #pragma warning(push) |
| 556 | #pragma warning(disable : 4996) // getenv |
| 557 | #endif |
| 558 | const char* envPortOffset = ::getenv("SC_TEST_PORT_OFFSET"); |
| 559 | #if SC_COMPILER_MSVC |
| 560 | #pragma warning(pop) |
| 561 | #endif |
| 562 | (void)parsePortOffset(envPortOffset, portOffset); |
| 563 | |
| 564 | StringSpan explicitLibraryRoot; |
| 565 | bool explicitLibraryRootProvided = false; |
| 566 | |
| 567 | for (int idx = 1; idx < argc; ++idx) |
| 568 | { |
| 569 | const auto param = StringSpan::fromNullTerminated(argv[idx], StringEncoding::Ascii); |
| 570 | if (param == "--quiet") |
| 571 | { |
| 572 | quietMode = true; |
| 573 | } |
| 574 | if (param == "--test" && testToRun.isEmpty()) |
| 575 | { |
| 576 | if (idx + 1 < argc) |
| 577 | { |
| 578 | testToRun = StringSpan::fromNullTerminated(argv[idx + 1], StringEncoding::Ascii); |
| 579 | if (not quietMode) |
| 580 | { |
| 581 | console.print("TestReport::Running single test \"{}\"\n", testToRun); |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | if (param == "--test-section" && sectionToRun.isEmpty()) |
| 586 | { |
| 587 | if (idx + 1 < argc) |
| 588 | { |
| 589 | sectionToRun = StringSpan::fromNullTerminated(argv[idx + 1], StringEncoding::Ascii); |
| 590 | |
| 591 | if (not quietMode) |
| 592 | { |
| 593 | console.print("TestReport::Running single section \"{}\"\n", sectionToRun); |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | if (param == "--port-offset") |
| 598 | { |
| 599 | if (idx + 1 < argc) |
| 600 | { |
| 601 | uint16_t parsedOffset = portOffset; |
| 602 | if (parsePortOffset(argv[idx + 1], parsedOffset)) |
| 603 | { |
| 604 | portOffset = parsedOffset; |
| 605 | } |
| 606 | } |
| 607 | } |
| 608 | if (param == "--all-tests") |
| 609 | { |
nothing calls this directly
no test coverage detected