20
20
STANDARD_PATH : bindings/rust/standard
21
21
EXAMPLE_WORKSPACE : bindings/rust-examples
22
22
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
23
25
24
26
jobs :
25
27
generate :
75
77
# invoked on the `cargo test --all-features` pattern.
76
78
run : RUST_LOG=TRACE cargo test --no-default-features --features pq
77
79
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
+
78
91
external-build-test :
79
92
runs-on : ubuntu-latest
80
93
steps :
@@ -112,8 +125,6 @@ jobs:
112
125
# means that if the linker can't resolve foo_method in tls/foo.c, you
113
126
# forgot to include api/unstable/foo.h in tls/foo.c
114
127
run : |
115
- set -e
116
-
117
128
cmake . -Bbuild \
118
129
-DBUILD_SHARED_LIBS=on \
119
130
-DBUILD_TESTING=off \
@@ -137,8 +148,9 @@ jobs:
137
148
138
149
echo ""
139
150
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}})
142
154
echo "${output}"
143
155
echo "${output}" | grep -q "test result: ok. 1 passed; 0 failed; 0 ignored;"
144
156
0 commit comments