1# Test the 'oneof' feature for generating C unions.
2
3Import('env')
4
5env.NanopbProto('oneof')
6
7enc = env.Program(['encode_oneof.c',
8                'oneof.pb.c',
9                '$COMMON/pb_encode.o',
10                '$COMMON/pb_common.o'])
11
12dec = env.Program(['decode_oneof.c',
13                'oneof.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'], ARGS = ['1'])
19env.RunTest("message2.pb", enc, ARGS = ['2'])
20env.RunTest("message2.txt", [dec, 'message2.pb'], ARGS = ['2'])
21env.RunTest("message3.pb", enc, ARGS = ['3'])
22env.RunTest("message3.txt", [dec, 'message3.pb'], ARGS = ['3'])
23