diff --git a/Makefile.am b/Makefile.am index 9d0117c..01a90c1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -185,6 +185,29 @@ BUILT_SOURCES += \ t/test-full.pb.cc t/test-full.pb.h \ t/generated-code2/test-full-cxx-output.inc +if BUILD_PROTO3 + +check_PROGRAMS += \ + t/generated-code3/test-generated-code3 + +TESTS += \ + t/generated-code3/test-generated-code3 + +t_generated_code3_test_generated_code3_LDADD = \ + protobuf-c/libprotobuf-c.la + +t_generated_code3_test_generated_code3_SOURCES = \ + t/generated-code/test-generated-code.c \ + t/test-proto3.pb-c.c + +t/test-proto3.pb-c.c t/test-proto3.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/test-proto3.proto + $(AM_V_GEN)@PROTOC@ --plugin=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/test-proto3.proto + +BUILT_SOURCES += \ + t/test-proto3.pb-c.c t/test-proto3.pb-c.h + +endif # BUILD_PROTO3 + t_version_version_SOURCES = \ t/version/version.c t_version_version_LDADD = \ @@ -197,6 +220,7 @@ EXTRA_DIST += \ t/test.proto \ t/test-full.proto \ t/test-optimized.proto \ + t/test-proto3.proto \ t/generated-code2/common-test-arrays.h # diff --git a/t/test-proto3.proto b/t/test-proto3.proto new file mode 100644 index 0000000..41da791 --- /dev/null +++ b/t/test-proto3.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package foo; + +message Person { + string name = 1; + int32 id = 2; + string email = 3; + + enum PhoneType { + MOBILE = 0; + HOME = 1; + WORK = 2; + } + + message PhoneNumber { + string number = 1; + PhoneType type = 2; + } + + repeated PhoneNumber phone = 4; +} + +message LookupResult +{ + Person person = 1; +} + +message Name { + string name = 1; +}; + +service DirLookup { + rpc ByName (Name) returns (LookupResult); +}