Skip to content

Commit ce5d684

Browse files
committed
pr feedback
1 parent d9a4a90 commit ce5d684

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/ci_rust.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ env:
2020
STANDARD_PATH: bindings/rust/standard
2121
EXAMPLE_WORKSPACE: bindings/rust-examples
2222
PCAP_TEST_PATH: tests/pcap
23+
# The name of a s2n-tls test gated behind the external build cfg flag.
24+
EXTERNAL_BUILD_TEST_NAME: test_unstable_as_ptr
2325

2426
jobs:
2527
generate:
@@ -75,6 +77,17 @@ jobs:
7577
# invoked on the `cargo test --all-features` pattern.
7678
run: RUST_LOG=TRACE cargo test --no-default-features --features pq
7779

80+
- name: Test external build cfg
81+
working-directory: ${{env.ROOT_PATH}}/s2n-tls
82+
run: |
83+
echo "Using the external build feature should set a cfg flag in s2n-tls. Ensure that"
84+
echo "this flag is NOT set when the external build feature isn't used. The"
85+
echo "${{EXTERNAL_BUILD_TEST_NAME}} test is gated behind this flag, so ensure this test"
86+
echo "is NOT run."
87+
output=$(cargo test ${{EXTERNAL_BUILD_TEST_NAME}})
88+
echo "${output}"
89+
echo "${output}" | grep -q "test result: ok. 0 passed; 0 failed; 0 ignored;"
90+
7891
external-build-test:
7992
runs-on: ubuntu-latest
8093
steps:
@@ -112,8 +125,6 @@ jobs:
112125
# means that if the linker can't resolve foo_method in tls/foo.c, you
113126
# forgot to include api/unstable/foo.h in tls/foo.c
114127
run: |
115-
set -e
116-
117128
cmake . -Bbuild \
118129
-DBUILD_SHARED_LIBS=on \
119130
-DBUILD_TESTING=off \
@@ -137,8 +148,9 @@ jobs:
137148
138149
echo ""
139150
echo "Test that the external build will enable the proper cfg flag in s2n-tls. The"
140-
echo "test_unstable_as_ptr test is gated behind this flag, so ensure this test is run."
141-
output=$(cargo test --manifest-path ${{env.ROOT_PATH}}/s2n-tls/Cargo.toml test_unstable_as_ptr)
151+
echo "${{EXTERNAL_BUILD_TEST_NAME}} test is gated behind this flag, so ensure this test"
152+
echo "is run."
153+
output=$(cargo test --manifest-path ${{env.ROOT_PATH}}/s2n-tls/Cargo.toml ${{EXTERNAL_BUILD_TEST_NAME}})
142154
echo "${output}"
143155
echo "${output}" | grep -q "test result: ok. 1 passed; 0 failed; 0 ignored;"
144156

0 commit comments

Comments
 (0)