a8584dc02218df7aeee4645348c3d91375dfd48d
[apps/agl-service-can-low-level.git] / tests / field_size_32 / SConscript
1 # Run the alltypes test case, but compile with PB_FIELD_32BIT=1.
2 # Also the .proto file has been modified to have high indexes.
3
4 Import("env")
5
6 # Take copy of the files for custom build.
7 c = Copy("$TARGET", "$SOURCE")
8 env.Command("pb_encode.c", "#../pb_encode.c", c)
9 env.Command("pb_decode.c", "#../pb_decode.c", c)
10 env.Command("encode_alltypes.c", "#alltypes/encode_alltypes.c", c)
11 env.Command("decode_alltypes.c", "#alltypes/decode_alltypes.c", c)
12
13 env.NanopbProto("alltypes")
14
15 # Define the compilation options
16 opts = env.Clone()
17 opts.Append(CPPDEFINES = {'PB_FIELD_32BIT': 1})
18
19 # Now build and run the test normally.
20 enc = opts.Program(["encode_alltypes.c", "alltypes.pb.c", "pb_encode.c"])
21 dec = opts.Program(["decode_alltypes.c", "alltypes.pb.c", "pb_decode.c"])
22
23 env.RunTest(enc)
24 env.RunTest([dec, "encode_alltypes.output"])