build_test.sh 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #! /bin/sh
  2. #
  3. # Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved
  4. #
  5. # This file is part of Embedded Proto.
  6. #
  7. # Embedded Proto is open source software: you can redistribute it and/or
  8. # modify it under the terms of the GNU General Public License as published
  9. # by the Free Software Foundation, version 3 of the license.
  10. #
  11. # Embedded Proto is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with Embedded Proto. If not, see <https://www.gnu.org/licenses/>.
  18. #
  19. # For commercial and closed source application please visit:
  20. # <https://EmbeddedProto.com/license/>.
  21. #
  22. # Embedded AMS B.V.
  23. # Info:
  24. # info at EmbeddedProto dot com
  25. #
  26. # Postal address:
  27. # Johan Huizingalaan 763a
  28. # 1066 VH, Amsterdam
  29. # the Netherlands
  30. #
  31. # Generate sources using the EAMS plugin.
  32. mkdir -p ./build/EAMS
  33. protoc --plugin=protoc-gen-eams=protoc-gen-eams -I./test/proto --eams_out=./build/EAMS ./test/proto/simple_types.proto
  34. protoc --plugin=protoc-gen-eams=protoc-gen-eams -I./test/proto --eams_out=./build/EAMS ./test/proto/nested_message.proto
  35. protoc --plugin=protoc-gen-eams=protoc-gen-eams -I./test/proto --eams_out=./build/EAMS ./test/proto/repeated_fields.proto
  36. protoc --plugin=protoc-gen-eams=protoc-gen-eams -I./test/proto --eams_out=./build/EAMS ./test/proto/oneof_fields.proto
  37. protoc --plugin=protoc-gen-eams=protoc-gen-eams -I./test/proto --eams_out=./build/EAMS ./test/proto/include_other_files.proto
  38. # Delibertly do not manually generate file_to_include.proto and subfolder/file_to_include_from_subfolder.proto
  39. # to test the automatic generation of files from including them in include_other_files.proto.
  40. protoc --plugin=protoc-gen-eams=protoc-gen-eams -I./test/proto --eams_out=./build/EAMS ./test/proto/string_bytes.proto
  41. protoc --plugin=protoc-gen-eams=protoc-gen-eams -I./test/proto --eams_out=./build/EAMS ./test/proto/empty_message.proto
  42. # For validation and testing generate the same message using python
  43. mkdir -p ./build/python
  44. protoc -I./test/proto --python_out=./build/python ./test/proto/simple_types.proto
  45. protoc -I./test/proto --python_out=./build/python ./test/proto/nested_message.proto
  46. protoc -I./test/proto --python_out=./build/python ./test/proto/repeated_fields.proto
  47. protoc -I./test/proto --python_out=./build/python ./test/proto/oneof_fields.proto
  48. protoc -I./test/proto --python_out=./build/python ./test/proto/include_other_files.proto
  49. protoc -I./test/proto --python_out=./build/python ./test/proto/file_to_include.proto
  50. protoc -I./test/proto --python_out=./build/python ./test/proto/string_bytes.proto
  51. # Build the tests
  52. mkdir -p build/test
  53. cd build/test/
  54. cmake -DCMAKE_BUILD_TYPE=Debug ../../
  55. make -j16