| 45 | #endif |
| 46 | |
| 47 | SC::AsyncTest::AsyncTest(SC::TestReport& report) : TestCase(report, "AsyncTest") |
| 48 | { |
| 49 | if (test_section("process input output child", TestCase::Execute::OnlyExplicit)) |
| 50 | { |
| 51 | processInputOutputChild(); |
| 52 | } |
| 53 | |
| 54 | int numTestsToRun = 1; |
| 55 | if (AsyncEventLoop::tryProbingIOUring()) |
| 56 | { |
| 57 | // Run all tests on epoll backend first, and then re-run them on io_uring |
| 58 | options.apiType = AsyncEventLoop::Options::ApiType::ForceUseEpoll; |
| 59 | numTestsToRun = 2; |
| 60 | } |
| 61 | if (test_section("loop io_uring probe")) |
| 62 | { |
| 63 | #if SC_PLATFORM_LINUX |
| 64 | if (AsyncEventLoop::tryProbingIOUring()) |
| 65 | { |
| 66 | AsyncEventLoop eventLoop; |
| 67 | AsyncEventLoop::Options probeOptions; |
| 68 | probeOptions.apiType = AsyncEventLoop::Options::ApiType::ForceUseIoUring; |
| 69 | SC_TEST_EXPECT(eventLoop.create(probeOptions)); |
| 70 | SC_TEST_EXPECT(eventLoop.close()); |
| 71 | } |
| 72 | else if (not report.quietMode) |
| 73 | { |
| 74 | report.console.printLine("AsyncTest - Skipping direct io_uring probe: io_uring unavailable"); |
| 75 | } |
| 76 | #endif |
| 77 | } |
| 78 | for (int i = 0; i < numTestsToRun; ++i) |
| 79 | { |
| 80 | if (test_section("loop free submitting on close")) |
| 81 | { |
| 82 | loopFreeSubmittingOnClose(); |
| 83 | } |
| 84 | if (test_section("loop free active on close")) |
| 85 | { |
| 86 | loopFreeActiveOnClose(); |
| 87 | } |
| 88 | if (test_section("loop interrupt")) |
| 89 | { |
| 90 | loopInterrupt(); |
| 91 | } |
| 92 | if (test_section("loop work")) |
| 93 | { |
| 94 | loopWork(); |
| 95 | } |
| 96 | if (test_section("loop timeout")) |
| 97 | { |
| 98 | loopTimeout(); |
| 99 | } |
| 100 | if (test_section("loop wakeUpFromExternalThread")) |
| 101 | { |
| 102 | loopWakeUpFromExternalThread(); |
| 103 | } |
| 104 | if (test_section("loop wakeUp")) |
nothing calls this directly
no test coverage detected