From 8ce4384fab8a343c4f5abe3ecf9456694b2c1d42 Mon Sep 17 00:00:00 2001 From: allen Date: Mon, 26 Jun 2023 18:38:17 +0800 Subject: support grpc_cpp_plugin #3148 --- .../c++/protobuf_grpc_cpp_plugin/src/main.cpp | 11 +++++++++++ .../src/subdir/test2.proto | 8 ++++++++ .../c++/protobuf_grpc_cpp_plugin/src/test.proto | 22 ++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 tests/projects/c++/protobuf_grpc_cpp_plugin/src/main.cpp create mode 100644 tests/projects/c++/protobuf_grpc_cpp_plugin/src/subdir/test2.proto create mode 100644 tests/projects/c++/protobuf_grpc_cpp_plugin/src/test.proto (limited to 'tests/projects/c++/protobuf_grpc_cpp_plugin/src') diff --git a/tests/projects/c++/protobuf_grpc_cpp_plugin/src/main.cpp b/tests/projects/c++/protobuf_grpc_cpp_plugin/src/main.cpp new file mode 100644 index 000000000..dc06458ae --- /dev/null +++ b/tests/projects/c++/protobuf_grpc_cpp_plugin/src/main.cpp @@ -0,0 +1,11 @@ +#include +#include "test.pb.h" +#include "subdir/test2.pb.h" + +using namespace std; + +int main(int argc, char** argv) +{ + cout << "hello world!" << endl; + return 0; +} diff --git a/tests/projects/c++/protobuf_grpc_cpp_plugin/src/subdir/test2.proto b/tests/projects/c++/protobuf_grpc_cpp_plugin/src/subdir/test2.proto new file mode 100644 index 000000000..811cdac3e --- /dev/null +++ b/tests/projects/c++/protobuf_grpc_cpp_plugin/src/subdir/test2.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package test2; +message TestCase2 { + string name2 = 4; +} +message Test2 { + repeated TestCase2 case2 = 1; +} diff --git a/tests/projects/c++/protobuf_grpc_cpp_plugin/src/test.proto b/tests/projects/c++/protobuf_grpc_cpp_plugin/src/test.proto new file mode 100644 index 000000000..d486ef316 --- /dev/null +++ b/tests/projects/c++/protobuf_grpc_cpp_plugin/src/test.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +import "subdir/test2.proto"; +package test; +message TestCase { + string name = 4; +} +message Test { + repeated TestCase case = 1; + repeated test2.TestCase2 case2 = 2; +} + +message EchoRequest { + string data = 1; +} + +message EchoResponse { + string data = 1; +} + +service EchoServer { + rpc Echo(EchoRequest) returns (EchoResponse); +} -- cgit v1.3.1