diff options
Diffstat (limited to 'test cases/frameworks/5 protocol buffers/withpath')
4 files changed, 46 insertions, 0 deletions
diff --git a/test cases/frameworks/5 protocol buffers/withpath/com/mesonbuild/simple.proto b/test cases/frameworks/5 protocol buffers/withpath/com/mesonbuild/simple.proto new file mode 100644 index 0000000..336779f --- /dev/null +++ b/test cases/frameworks/5 protocol buffers/withpath/com/mesonbuild/simple.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +package subdirectorial; + +message SimpleMessage { + int32 the_integer = 1; +} diff --git a/test cases/frameworks/5 protocol buffers/withpath/com/mesonbuild/subsite/complex.proto b/test cases/frameworks/5 protocol buffers/withpath/com/mesonbuild/subsite/complex.proto new file mode 100644 index 0000000..8dc32c2 --- /dev/null +++ b/test cases/frameworks/5 protocol buffers/withpath/com/mesonbuild/subsite/complex.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package subdirectorial; + +import "com/mesonbuild/simple.proto"; + +message ComplexMessage { + string a_message = 1; + SimpleMessage sm = 2; +} diff --git a/test cases/frameworks/5 protocol buffers/withpath/meson.build b/test cases/frameworks/5 protocol buffers/withpath/meson.build new file mode 100644 index 0000000..68a7381 --- /dev/null +++ b/test cases/frameworks/5 protocol buffers/withpath/meson.build @@ -0,0 +1,13 @@ +# Testing protobuf files that are deeply hierarchical +# and must preserve their path segments in output files +# because protoc will always put it in there. + +generated = gen.process('com/mesonbuild/simple.proto', + 'com/mesonbuild/subsite/complex.proto', + preserve_path_from : meson.current_source_dir(), + ) + +e = executable('pathprog', 'pathprog.cpp', generated, + override_options : ['unity=off'], + dependencies : dep) +test('pathprog', e) diff --git a/test cases/frameworks/5 protocol buffers/withpath/pathprog.cpp b/test cases/frameworks/5 protocol buffers/withpath/pathprog.cpp new file mode 100644 index 0000000..83af4b2 --- /dev/null +++ b/test cases/frameworks/5 protocol buffers/withpath/pathprog.cpp @@ -0,0 +1,16 @@ +#include"com/mesonbuild/simple.pb.h" +#include"com/mesonbuild/subsite/complex.pb.h" + +#include<memory> + +int main(int argc, char **argv) { + GOOGLE_PROTOBUF_VERIFY_VERSION; + { + subdirectorial::SimpleMessage *s = new subdirectorial::SimpleMessage(); + s->set_the_integer(3); + subdirectorial::ComplexMessage c; + c.set_allocated_sm(s); + } + google::protobuf::ShutdownProtobufLibrary(); + return 0; +} |