Skip to content

Commit 48d1863

Browse files
committed
Run the integration test script explicitly with /bin/bash in the Github CI action.
Otherwise there would have to be executable permissions on the script, which is not the case in the Github repository. PiperOrigin-RevId: 497354038
1 parent c88937b commit 48d1863

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ jobs:
2020
run: cargo build --verbose
2121
- name: Run tests
2222
run: cargo test --verbose
23+
- name: Run integration tests
24+
run: /bin/bash ./run_integration_tests.sh

googletest/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ name = "custom_error_message"
4646
path = "integration_tests/custom_error_message.rs"
4747
test = false
4848

49+
[[bin]]
50+
name = "assert_predicate_with_failure"
51+
path = "integration_tests/assert_predicate_with_failure.rs"
52+
test = false
53+
4954
[[bin]]
5055
name = "assertion_failure_in_subroutine"
5156
path = "integration_tests/assertion_failure_in_subroutine.rs"

googletest/integration_tests/integration_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ Actual: 1, which isn't equal to 2
414414

415415
fn run_external_process(name: &'static str) -> Command {
416416
let command_path = format!(
417-
"../{}/debug/{name}",
417+
"./{}/debug/{name}",
418418
std::env::var("CARGO_TARGET_DIR").unwrap_or_else(|_| "target".into())
419419
);
420420
Command::new(command_path)

run_integration_tests.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
#
3+
# Copyright 2022 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Shell script to build and run the library integration tests. These will not be
18+
# run with "cargo test" due to limitations in Cargo.
19+
#
20+
# To use this, just run the script in the root directory of GoogleTest Rust. You
21+
# must have the Rust toolchain available.
22+
23+
set -e
24+
25+
INTEGRATION_TEST_BINARIES=(
26+
"integration_tests"
27+
"assert_predicate_with_failure"
28+
"simple_assertion_failure"
29+
"simple_assertion_failure_with_assert_that"
30+
)
31+
32+
cargo build
33+
for binary in ${INTEGRATION_TEST_BINARIES[@]}; do
34+
cargo rustc -p googletest --bin $binary -- --test
35+
done
36+
./target/debug/integration_tests

0 commit comments

Comments
 (0)