| # Build file to set up and run tests |
| # Print bazel testlogs to stdout when tests failed. |
| function print_test_logs { |
| # TODO(yannic): Only print logs of failing tests. |
| testlogs_dir=$(bazel info bazel-testlogs) |
| testlogs=$(find "${testlogs_dir}" -name "*.log") |
| cd $(dirname $0)/../../.. |
| git submodule update --init --recursive |
| # Disabled for now, re-enable if appropriate. |
| # //:build_files_updated_unittest \ |
| trap print_test_logs EXIT |
| bazel test -k --copt=-Werror --host_copt=-Werror \ |
| # Verify that we can build successfully from generated tar files. |
| ./autogen.sh && ./configure && make -j$(nproc) dist |
| bazel build //:protobuf //:protobuf_java |