1# Test anonymous_oneof generator option
2
3Import('env')
4
5# Anonymous oneofs are supported by clang and gcc
6if 'clang' in env['CC'] or 'gcc' in env['CC']:
7    env2 = env.Clone()
8    if '-pedantic' in env2['CFLAGS']:
9        env2['CFLAGS'].remove('-pedantic')
10    env2.NanopbProto('oneof')
11
12    dec = env2.Program(['decode_oneof.c',
13                        'oneof.pb.c',
14                        '$COMMON/pb_decode.o',
15                        '$COMMON/pb_common.o'])
16
17    env2.RunTest("message1.txt", [dec, '$BUILD/oneof/message1.pb'], ARGS = ['1'])
18    env2.RunTest("message2.txt", [dec, '$BUILD/oneof/message2.pb'], ARGS = ['2'])
19    env2.RunTest("message3.txt", [dec, '$BUILD/oneof/message3.pb'], ARGS = ['3'])
20