xref: /aosp_15_r20/external/grpc-grpc/test/core/event_engine/test_suite/event_engine_test_framework.cc (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1 // Copyright 2021 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #include "test/core/event_engine/test_suite/event_engine_test_framework.h"
15 
16 #include <gtest/gtest.h>
17 
18 #include <grpc/event_engine/event_engine.h>
19 
20 absl::AnyInvocable<
21     std::shared_ptr<grpc_event_engine::experimental::EventEngine>()>*
22     g_ee_factory = nullptr;
23 
24 absl::AnyInvocable<
25     std::shared_ptr<grpc_event_engine::experimental::EventEngine>()>*
26     g_oracle_ee_factory = nullptr;
27 
SetEventEngineFactories(absl::AnyInvocable<std::shared_ptr<grpc_event_engine::experimental::EventEngine> ()> factory,absl::AnyInvocable<std::shared_ptr<grpc_event_engine::experimental::EventEngine> ()> oracle_ee_factory)28 void SetEventEngineFactories(
29     absl::AnyInvocable<
30         std::shared_ptr<grpc_event_engine::experimental::EventEngine>()>
31         factory,
32     absl::AnyInvocable<
33         std::shared_ptr<grpc_event_engine::experimental::EventEngine>()>
34         oracle_ee_factory) {
35   testing::AddGlobalTestEnvironment(new EventEngineTestEnvironment(
36       std::move(factory), std::move(oracle_ee_factory)));
37 }
38