mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-12 07:50:59 +00:00
Allow to run cpp tests under grpc/tests/ using bazel. (#6040)
This is the first step to upgrade grpc dependency to the latest version. - Patch protobuf 3.6.1. and grpc 1.15.1 to fix build errors when using the latest Bazel version (3.4.1). - Add grpc/tests:grpc_test. One can kick off tests in Bazel by calling `bazel test grpc/tests/...`. - Add missing build targets in tests/BUILD in order to support grpc/tests/BUILD
This commit is contained in:
0
grpc/BUILD
Normal file
0
grpc/BUILD
Normal file
@@ -22,6 +22,12 @@ the GRPC libraries for this to compile. This test will build using the
|
||||
5. `cmake -DFLATBUFFERS_BUILD_GRPCTEST=ON -DGRPC_INSTALL_PATH=${GRPC_INSTALL_PATH} -DPROTOBUF_DOWNLOAD_PATH=${PROTOBUF_DOWNLOAD_PATH} ..`
|
||||
6. `make`
|
||||
|
||||
For Bazel users:
|
||||
|
||||
```shell
|
||||
$bazel test src/compiler/...
|
||||
```
|
||||
|
||||
## Running FlatBuffer gRPC tests
|
||||
|
||||
### Linux
|
||||
@@ -29,3 +35,9 @@ the GRPC libraries for this to compile. This test will build using the
|
||||
1. `ln -s ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.6 ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.1`
|
||||
2. `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GRPC_INSTALL_PATH}/lib`
|
||||
3. `make test ARGS=-V`
|
||||
|
||||
For Bazel users:
|
||||
|
||||
```shell
|
||||
$bazel test tests/...
|
||||
```
|
||||
@@ -104,4 +104,4 @@ cc_library(
|
||||
deps = [
|
||||
"//:flatbuffers",
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
17
grpc/tests/BUILD
Normal file
17
grpc/tests/BUILD
Normal file
@@ -0,0 +1,17 @@
|
||||
cc_test(
|
||||
name = "grpc_test",
|
||||
srcs = [
|
||||
"grpctest.cpp",
|
||||
"message_builder_test.cpp",
|
||||
],
|
||||
copts = ["-Itests"],
|
||||
# This is required.
|
||||
linkstatic = 1,
|
||||
deps = [
|
||||
"//tests:monster_test_cc_fbs",
|
||||
"//tests:monster_test_grpc",
|
||||
"//tests:test_assert",
|
||||
"//tests:test_builder",
|
||||
"@com_github_grpc_grpc//:grpc++",
|
||||
],
|
||||
)
|
||||
Reference in New Issue
Block a user