• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 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 
15 #include "absl/random/random.h"
16 #include "src/core/lib/debug/trace.h"
17 #include "test/core/call/yodel/yodel_test.h"
18 #include "test/core/test_util/test_config.h"
19 
main(int argc,char ** argv)20 int main(int argc, char** argv) {
21   grpc_core::g_yodel_fuzzing = false;
22   grpc::testing::TestEnvironment env(&argc, argv);
23   absl::BitGen bitgen;
24   ::testing::InitGoogleTest(&argc, argv);
25   static grpc_core::NoDestruct<
26       std::vector<grpc_core::yodel_detail::TestRegistry::Test>>
27       tests{grpc_core::yodel_detail::TestRegistry::AllTests()};
28   CHECK(!tests->empty());
29   for (const auto& test : *tests) {
30     CHECK(test.make != nullptr) << "test:" << test.name;
31     ::testing::RegisterTest(
32         test.test_type.c_str(), test.name.c_str(), nullptr, nullptr, __FILE__,
33         __LINE__, [test = &test, &bitgen]() -> grpc_core::YodelTest* {
34           return test->make(fuzzing_event_engine::Actions(), bitgen);
35         });
36   }
37   grpc_tracer_init();
38   return RUN_ALL_TESTS();
39 }
40