Debian Codegraph @

test/core/event_engine/test_suite/README.md

raw
1 A reusable test suite for EventEngine implementations.
2
3 To exercise a custom EventEngine, create a new bazel test target that links
4 against the `//test/core/event_engine/test_suite:complete` library, and provide
5 a testing `main` function that sets a custom EventEngine factory.
6
7 Your custom test target will look something like:
8
9 ```
10 grpc_cc_test(
11 name = "my_custom_event_engine_test",
12 srcs = ["my_custom_event_engine_test.cc"],
13 uses_polling = False,
14 deps = ["//test/core/event_engine/test_suite:complete"],
15 )
16 ```
17
18 And the main function will be similar to:
19
20 ```
21 #include "path/to/my_custom_event_engine.h"
22 #include "test/core/event_engine/test_suite/event_engine_test.h"
23
24 int main(int argc, char** argv) {
25 testing::InitGoogleTest(&argc, argv);
26 SetEventEngineFactory(
27 []() { return absl::make_unique<MyCustomEventEngine>(); });
28 auto result = RUN_ALL_TESTS();
29 return result;
30 }
31 ```
32
33 Alternatively, if you only want to exercise a subset of the conformance tests,
34 you could depend on any subset of the following:
35
36 * `//test/core/event_engine/test_suite:timer`
37 * `//test/core/event_engine/test_suite:dns`
38 * `//test/core/event_engine/test_suite:client`
39 * `//test/core/event_engine/test_suite:server`