1# Test the 'msgid' feature for identifying encoded messages
2
3Import('env')
4
5env.NanopbProto('msgid_example')
6
7enc = env.Program(['encode_msgid.c',
8                'msgid_example.pb.c',
9                '$COMMON/pb_encode.o',
10                '$COMMON/pb_common.o'])
11
12dec = env.Program(['decode_msgid.c',
13                'msgid_example.pb.c',
14                '$COMMON/pb_decode.o',
15                '$COMMON/pb_common.o'])
16
17env.RunTest("message1.pb", enc, ARGS = ['1'])
18env.RunTest("message1.txt", [dec, 'message1.pb'])
19env.RunTest("message2.pb", enc, ARGS = ['2'])
20env.RunTest("message2.txt", [dec, 'message2.pb'])
21env.RunTest("message3.pb", enc, ARGS = ['3'])
22env.RunTest("message3.txt", [dec, 'message3.pb'])
23