1 /** @file
2  *
3  *  A brief file description
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 // To make compile faster
25 // https://github.com/philsquared/Catch/blob/master/docs/slow-compiles.md
26 #define CATCH_CONFIG_MAIN
27 #include "catch.hpp"
28 
29 #include "tscore/I_Layout.h"
30 #include "tscore/Diags.h"
31 
32 #include "RecordsConfig.h"
33 #include "QUICGlobals.h"
34 #include "QUICConfig.h"
35 
36 struct EventProcessorListener : Catch::TestEventListenerBase {
37   using TestEventListenerBase::TestEventListenerBase; // inherit constructor
38 
39   void
testRunStartingEventProcessorListener40   testRunStarting(Catch::TestRunInfo const &testRunInfo) override
41   {
42     BaseLogFile *base_log_file = new BaseLogFile("stderr");
43     diags                      = new Diags(testRunInfo.name, "" /* tags */, "" /* actions */, base_log_file);
44     diags->activate_taglist("vv_quic|quic", DiagsTagType_Debug);
45     diags->config.enabled[DiagsTagType_Debug] = true;
46     diags->show_location                      = SHOW_LOCATION_DEBUG;
47 
48     Layout::create();
49     RecProcessInit(RECM_STAND_ALONE);
50     LibRecordsConfigInit();
51 
52     QUICConfig::startup();
53     QUIC::init();
54 
55     EThread *thread = new EThread();
56     thread->set_specific();
57     init_buffer_allocators(0);
58   }
59 };
60 CATCH_REGISTER_LISTENER(EventProcessorListener);
61