microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.16k stars 6.39k forks source link

[grpc] build gRPC with test code available #13319

Open ahaeber opened 4 years ago

ahaeber commented 4 years ago

Is your feature request related to a problem? Please describe. Currently gRPC is built with -DgRPC_BUILD_TESTS=OFF. Therefore gRPC support for testing (e.g., mocks) is unavailable.

Proposed solution Change the setting to ON.

Describe alternatives you've considered I've followed https://github.com/grpc/grpc/issues/20208 (gRPC github issue) where it was proposed to change gRPC to include test headers by default. Then due to build problems that change was reverted.

Additional context See https://grpc.github.io/grpc/cpp/md_doc_unit_testing.html for a tutorial on testing gRPC services with mocks. Notice that it includes <grpcpp/test/default_reactor_test_peer.h> which is only available if gRPC is built with gRPC_BUILD_TESTS=ON.

JackBoosY commented 4 years ago

Thanks for pointing this out!

Dlougach commented 4 years ago

I don't think that changing this setting to on will install includes from grpcpp/test

JackBoosY commented 4 years ago

@Dlougach That will only test whether the program is damaged.