Separation Generator to a dedicated repo
[apps/low-level-can-service.git] / libs / nanopb / tests / no_errmsg / SConscript
1 # Run the alltypes test case, but compile with PB_NO_ERRMSG=1
2
3 Import("env")
4
5 # Take copy of the files for custom build.
6 c = Copy("$TARGET", "$SOURCE")
7 env.Command("alltypes.pb.h", "$BUILD/alltypes/alltypes.pb.h", c)
8 env.Command("alltypes.pb.c", "$BUILD/alltypes/alltypes.pb.c", c)
9 env.Command("encode_alltypes.c", "$BUILD/alltypes/encode_alltypes.c", c)
10 env.Command("decode_alltypes.c", "$BUILD/alltypes/decode_alltypes.c", c)
11
12 # Define the compilation options
13 opts = env.Clone()
14 opts.Append(CPPDEFINES = {'PB_NO_ERRMSG': 1})
15
16 # Build new version of core
17 strict = opts.Clone()
18 strict.Append(CFLAGS = strict['CORECFLAGS'])
19 strict.Object("pb_decode_noerr.o", "$NANOPB/pb_decode.c")
20 strict.Object("pb_encode_noerr.o", "$NANOPB/pb_encode.c")
21 strict.Object("pb_common_noerr.o", "$NANOPB/pb_common.c")
22
23 # Now build and run the test normally.
24 enc = opts.Program(["encode_alltypes.c", "alltypes.pb.c", "pb_encode_noerr.o", "pb_common_noerr.o"])
25 dec = opts.Program(["decode_alltypes.c", "alltypes.pb.c", "pb_decode_noerr.o", "pb_common_noerr.o"])
26
27 env.RunTest(enc)
28 env.RunTest([dec, "encode_alltypes.output"])