SConscript 718 B

12345678910111213141516171819202122
  1. # Test the 'oneof' feature for generating C unions.
  2. Import('env')
  3. env.NanopbProto('oneof')
  4. enc = env.Program(['encode_oneof.c',
  5. 'oneof.pb.c',
  6. '$COMMON/pb_encode.o',
  7. '$COMMON/pb_common.o'])
  8. dec = env.Program(['decode_oneof.c',
  9. 'oneof.pb.c',
  10. '$COMMON/pb_decode.o',
  11. '$COMMON/pb_common.o'])
  12. env.RunTest("message1.pb", enc, ARGS = ['1'])
  13. env.RunTest("message1.txt", [dec, 'message1.pb'], ARGS = ['1'])
  14. env.RunTest("message2.pb", enc, ARGS = ['2'])
  15. env.RunTest("message2.txt", [dec, 'message2.pb'], ARGS = ['2'])
  16. env.RunTest("message3.pb", enc, ARGS = ['3'])
  17. env.RunTest("message3.txt", [dec, 'message3.pb'], ARGS = ['3'])