aboutsummaryrefslogtreecommitdiffstats
path: root/tests/options
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2016-12-22 17:37:14 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2016-12-22 17:37:14 +0200
commit283258dca59c470e8e209431e206a344839e0cf5 (patch)
tree4dff46a4aaa3b3a496e7e7f1b6b423b542193a14 /tests/options
parent58af4d1fb733c5348b68dd3980f2a230d95400b4 (diff)
Allow overriding proto3 mode (#228)
Diffstat (limited to 'tests/options')
-rw-r--r--tests/options/SConscript5
-rw-r--r--tests/options/proto3_options.expected4
-rw-r--r--tests/options/proto3_options.proto11
3 files changed, 19 insertions, 1 deletions
diff --git a/tests/options/SConscript b/tests/options/SConscript
index 89a00fa5..215e3bd0 100644
--- a/tests/options/SConscript
+++ b/tests/options/SConscript
@@ -4,6 +4,9 @@ Import("env")
env.NanopbProto("options")
env.Object('options.pb.c')
-
env.Match(['options.pb.h', 'options.expected'])
+env.NanopbProto("proto3_options")
+env.Object('proto3_options.pb.c')
+env.Match(['proto3_options.pb.h', 'proto3_options.expected'])
+
diff --git a/tests/options/proto3_options.expected b/tests/options/proto3_options.expected
new file mode 100644
index 00000000..cc2f29c0
--- /dev/null
+++ b/tests/options/proto3_options.expected
@@ -0,0 +1,4 @@
+! bool has_proto3_default
+bool has_proto3_off
+! bool has_proto3_on
+
diff --git a/tests/options/proto3_options.proto b/tests/options/proto3_options.proto
new file mode 100644
index 00000000..1017f046
--- /dev/null
+++ b/tests/options/proto3_options.proto
@@ -0,0 +1,11 @@
+syntax = "proto3";
+
+import "nanopb.proto";
+
+message Message1
+{
+ int32 proto3_default = 1;
+ int32 proto3_off = 2 [(nanopb).proto3 = false];
+ int32 proto3_on = 3 [(nanopb).proto3 = true];
+}
+