This is an automated email from the ASF dual-hosted git repository.

JosiahWI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new bd785f4bd7 Use fixture listener in test_EventSystem (#13308)
bd785f4bd7 is described below

commit bd785f4bd79194836985d01c7637cd6bd45a3c5d
Author: JosiahWI <[email protected]>
AuthorDate: Tue Jun 23 13:30:47 2026 -0500

    Use fixture listener in test_EventSystem (#13308)
    
    This removes the Catch2 listener from test_EventSystem.cc, using
    the identical listener from inkevent_test_fixtures.h instead.
    
    There is a similar listener in the IOBuffer test, but it is not an
    exact duplicate (it calls `LibRecordsConfigInit`).
---
 .../eventsystem/unit_tests/test_EventSystem.cc     | 23 +++-------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/src/iocore/eventsystem/unit_tests/test_EventSystem.cc 
b/src/iocore/eventsystem/unit_tests/test_EventSystem.cc
index b9c24764c7..22a9d21cb9 100644
--- a/src/iocore/eventsystem/unit_tests/test_EventSystem.cc
+++ b/src/iocore/eventsystem/unit_tests/test_EventSystem.cc
@@ -21,6 +21,8 @@
   limitations under the License.
  */
 
+#include "inkevent_test_fixtures.h"
+
 #include <catch2/catch_test_macros.hpp>
 #include <catch2/reporters/catch_reporter_event_listener.hpp>
 #include <catch2/reporters/catch_reporter_registrars.hpp>
@@ -28,10 +30,9 @@
 
 #include "iocore/eventsystem/EventSystem.h"
 #include "tscore/ink_atomic.h"
-#include "tscore/Layout.h"
 #include "tscore/TSSystemState.h"
 
-#include "iocore/utils/diags.i"
+using inkevent_test::EventProcessorListener;
 
 #define TEST_TIME_SECOND 60
 #define TEST_THREADS     2
@@ -83,24 +84,6 @@ TEST_CASE("EventSystem", "[iocore]")
   }
 }
 
-struct EventProcessorListener : Catch::EventListenerBase {
-  using EventListenerBase::EventListenerBase;
-
-  void
-  testRunStarting(Catch::TestRunInfo const & /* testRunInfo ATS_UNUSED */) 
override
-  {
-    Layout::create();
-    init_diags("", nullptr);
-    RecProcessInit();
-
-    ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION);
-    eventProcessor.start(TEST_THREADS, 1048576); // Hardcoded stacksize at 1MB
-
-    EThread *main_thread = new EThread;
-    main_thread->set_specific();
-  }
-};
-
 CATCH_REGISTER_LISTENER(EventProcessorListener);
 
 TEST_CASE("EventSystemUnixSocket", "[iocore][sock]")

Reply via email to