A reusable test suite for EventEngine implementations.
To exercise a custom EventEngine, create a new bazel test target that links
against the //test/core/event_engine/test_suite:complete
library, and provide
a testing main
function that sets a custom EventEngine factory.
Your custom test target will look something like:
grpc_cc_test(
name = "my_custom_event_engine_test",
srcs = ["my_custom_event_engine_test.cc"],
uses_polling = False,
deps = ["//test/core/event_engine/test_suite:complete"],
)
And the main function will be similar to:
#include "path/to/my_custom_event_engine.h"
#include "src/core/event_engine/test_suite/event_engine_test.h"
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
SetEventEngineFactory(
[]() { return absl::make_unique<MyCustomEventEngine>(); });
auto result = RUN_ALL_TESTS();
return result;
}
Alternatively, if you only want to exercise a subset of the conformance tests, you could depend on any subset of the following:
//test/core/event_engine/test_suite:timer
//test/core/event_engine/test_suite:dns
//test/core/event_engine/test_suite:client
//test/core/event_engine/test_suite:server