1 /** @file 2 3 The main file for test_libhttp2 4 5 @section license License 6 7 Licensed to the Apache Software Foundation (ASF) under one 8 or more contributor license agreements. See the NOTICE file 9 distributed with this work for additional information 10 regarding copyright ownership. The ASF licenses this file 11 to you under the Apache License, Version 2.0 (the 12 "License"); you may not use this file except in compliance 13 with the License. You may obtain a copy of the License at 14 15 http://www.apache.org/licenses/LICENSE-2.0 16 17 Unless required by applicable law or agreed to in writing, software 18 distributed under the License is distributed on an "AS IS" BASIS, 19 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 See the License for the specific language governing permissions and 21 limitations under the License. 22 */ 23 24 #define CATCH_CONFIG_MAIN 25 #include "catch.hpp" 26 27 #include "tscore/I_Layout.h" 28 29 #include "I_EventSystem.h" 30 #include "RecordsConfig.h" 31 32 #include "diags.i" 33 34 #include "HuffmanCodec.h" 35 36 #define TEST_THREADS 1 37 38 struct EventProcessorListener : Catch::TestEventListenerBase { 39 using TestEventListenerBase::TestEventListenerBase; 40 41 void testRunStartingEventProcessorListener42 testRunStarting(Catch::TestRunInfo const & /* testRunInfo */) override 43 { 44 Layout::create(); 45 init_diags("", nullptr); 46 RecProcessInit(RECM_STAND_ALONE); 47 LibRecordsConfigInit(); 48 49 ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION); 50 eventProcessor.start(TEST_THREADS); 51 52 EThread *main_thread = new EThread; 53 main_thread->set_specific(); 54 55 hpack_huffman_init(); 56 } 57 58 void testRunEndedEventProcessorListener59 testRunEnded(Catch::TestRunStats const & /* testRunStats */) override 60 { 61 hpack_huffman_fin(); 62 } 63 }; 64 65 CATCH_REGISTER_LISTENER(EventProcessorListener); 66