SConscript 874 B

12345678910111213141516171819202122232425262728293031
  1. # Regression test for #610:
  2. # Error "'dict_values' object does not support indexing" while compiling .proto files
  3. Import("env")
  4. # First the simple case with two files
  5. env.NanopbProto("LogMessage.proto")
  6. env.NanopbProto(["DataPacket.proto", "LogMessage.proto"])
  7. env.Object("LogMessage.pb.c")
  8. env.Object("DataPacket.pb.c")
  9. # Then the complex hierarchy case
  10. all_files = [
  11. 'nanopb_generator_bug/first/a/aa.proto',
  12. 'nanopb_generator_bug/first/a/ab.proto',
  13. 'nanopb_generator_bug/first/a.proto',
  14. 'nanopb_generator_bug/first/b/ba.proto',
  15. 'nanopb_generator_bug/first/b.proto',
  16. 'nanopb_generator_bug/first.proto'
  17. ]
  18. env2 = env.Clone()
  19. env2.Append(CPPPATH = "$BUILD/regression/issue_610")
  20. for f in all_files:
  21. env2.NanopbProto([f] + all_files)
  22. for f in all_files:
  23. env2.Object(f.replace('.proto', '.pb.c'))
  24. env2.Match(["nanopb_generator_bug/first.pb.h", "first.expected"])