Skip to content

Commit aaf972b

Browse files
committed
remove binding tests
Signed-off-by: Jay Lee <[email protected]>
1 parent 166a842 commit aaf972b

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212
RUST_BACKTRACE: 1
1313
RUSTFLAGS: "--deny=warnings"
1414
GRPC_VERSION: 1.26.0
15+
TEST_BIND: 1
1516

1617
jobs:
1718
Linux-Format-PKG-Test:
@@ -37,7 +38,8 @@ jobs:
3738
- uses: actions/checkout@v2
3839
- run: which go && go version && which cargo && cargo version && clang --version && openssl version
3940
- run: scripts/reset-submodule.cmd
40-
- run: scripts/generate-bindings.sh && git diff --exit-code HEAD
41+
- run: env TEST_BIND=0 scripts/generate-bindings.sh && git diff --exit-code HEAD
42+
- run: scripts/generate-bindings.sh
4143
- run: cargo build --no-default-features
4244
- run: cargo build --no-default-features --features protobuf-codec
4345
- run: cargo build --no-default-features --features prost-codec
@@ -103,4 +105,4 @@ jobs:
103105
- run: go version ; cargo version ; cmake --version
104106
- run: scripts/reset-submodule.cmd
105107
- run: cargo build
106-
- run: cargo test --all
108+
- run: cargo test --all

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212
global:
1313
- RUST_BACKTRACE=1
1414
- RUSTFLAGS="--deny=warnings"
15+
- TEST_BIND=1
1516

1617
install:
1718
- if ! which go 2>/dev/null; then
@@ -72,12 +73,13 @@ jobs:
7273
- which go && go version
7374
- if [[ $TRAVIS_OS_NAME == "linux" ]] && [[ $TRAVIS_RUST_VERSION == "stable" ]]; then
7475
rustup component add rustfmt && cargo fmt --all -- --check;
75-
scripts/generate-bindings.sh && git diff --exit-code HEAD;
76+
env TEST_BIND=0 scripts/generate-bindings.sh && git diff --exit-code HEAD;
7677
fi
78+
- ./scripts/generate-bindings.sh
7779
- cargo build --no-default-features
7880
- cargo build --no-default-features --features protobuf-codec
7981
- cargo build --no-default-features --features prost-codec
8082
- cargo build
8183
- cargo test --all
8284
- cargo test --features "openssl" --all
83-
- cargo test --features "openssl-vendored" --all
85+
- cargo test --features "openssl-vendored" --all

grpc-sys/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ fn bindgen_grpc(mut config: bindgen::Builder, file_path: &PathBuf) {
299299
config = config.header(path);
300300
}
301301

302+
println!("cargo:rerun-if-env-changed=TEST_BIND");
303+
let gen_tests = env::var("TEST_BIND").map_or(false, |s| s == "1");
304+
302305
let cfg = config
303306
.header("grpc_wrap.cc")
304307
.clang_arg("-xc++")
@@ -323,6 +326,7 @@ fn bindgen_grpc(mut config: bindgen::Builder, file_path: &PathBuf) {
323326
.blacklist_type(r"gpr_cv")
324327
.blacklist_type(r"gpr_once")
325328
.constified_enum_module(r"grpc_status_code")
329+
.layout_tests(gen_tests)
326330
.default_enum_style(bindgen::EnumVariation::Rust {
327331
non_exhaustive: false,
328332
});

0 commit comments

Comments
 (0)