1# Version of AllTypes test case for protobuf 3 file format. 2 3Import("env") 4 5env.NanopbProto(["alltypes", "alltypes.options"]) 6 7# Define the compilation options 8opts = env.Clone() 9opts.Append(CPPDEFINES = {'PB_FIELD_16BIT': 1}) 10 11# Build new version of core 12strict = opts.Clone() 13strict.Append(CFLAGS = strict['CORECFLAGS']) 14strict.Object("pb_decode_fields16.o", "$NANOPB/pb_decode.c") 15strict.Object("pb_encode_fields16.o", "$NANOPB/pb_encode.c") 16strict.Object("pb_common_fields16.o", "$NANOPB/pb_common.c") 17 18# Now build and run the test normally. 19enc = opts.Program(["encode_alltypes.c", "alltypes.pb.c", "pb_encode_fields16.o", "pb_common_fields16.o"]) 20dec = opts.Program(["decode_alltypes.c", "alltypes.pb.c", "pb_decode_fields16.o", "pb_common_fields16.o"]) 21 22env.RunTest(enc) 23env.RunTest([dec, "encode_alltypes.output"]) 24