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