Import of the watch repository from Pebble

This commit is contained in:
Matthieu Jeanson 2024-12-12 16:43:03 -08:00 committed by Katharine Berry
commit 3b92768480
10334 changed files with 2564465 additions and 0 deletions

View file

@ -0,0 +1,44 @@
# Test correct relative paths and creation of intermediate directories
# when input files are part of a multi-level directory structure:
#
# user@host:.../build$ nanopb_generator -D . -I ../proto ../proto/simple.proto
# user@host:.../build$ nanopb_generator -D . -I ../proto ../proto/protobuf/any.proto
#
# should result in:
#
# |-- build
# | |-- protobuf
# | | +-- any.pb.c
# | | +-- any.pb.h
# | +-- simple.pb.c
# | +-- simple.pb.h
# +-- proto
# |-- protobuf
# | +-- any.proto
# +-- simple.proto
Import('env')
import os, sys
# As of 0.4.2, SCons rules still go through protoc that handles paths correctly
# by itself. To test direct nanopb_generator usage we invoke it manually here.
env.Command(["build/protobuf/any.pb.h", "build/simple.pb.h", "build/protobuf/any.pb.c", "build/simple.pb.c",],
["proto/protobuf/any.proto", "proto/simple.proto"],
[
Delete("$BUILDDIR/generator_relative_paths/build"),
Mkdir("$BUILDDIR/generator_relative_paths/build"),
env['NANOPB_GENERATOR'] + " -D$BUILDDIR/generator_relative_paths/build -I$BUILDDIR/generator_relative_paths/proto $SOURCES"
])
env.Match("simple_pb_h_ok", ["build/simple.pb.h", "simple.expected"])
env.Match("simple_pb_c_ok", ["build/simple.pb.c", "simple.expected"])
env.Match("any_pb_h_ok", ["build/protobuf/any.pb.h", "any.expected"])
env.Match("any_pb_c_ok", ["build/protobuf/any.pb.c", "any.expected"])
# Test when not using -D
env.Command(["test.pb.c", "test.pb.h"], "test.proto",
env['NANOPB_GENERATOR'] + " test.proto",
chdir = True)
env.Match("test_pb_h_ok", ["test.pb.h", "test.expected"])
env.Match("test_pb_c_ok", ["test.pb.c", "test.expected"])

View file

@ -0,0 +1 @@
Any

View file

@ -0,0 +1,8 @@
syntax = "proto3";
import "protobuf/any.proto";
message SimpleMessage {
google.protobuf.Any any = 1;
}

View file

@ -0,0 +1 @@
SimpleMessage

View file

@ -0,0 +1 @@
TestMessage

View file

@ -0,0 +1,7 @@
syntax="proto3";
import "nanopb.proto";
message TestMessage {
string foo = 1 [(nanopb).max_size = 16];
}