From 1c6774f75cd125728316790f12fa5e305fdb3ea0 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 6 Oct 2023 23:08:29 -0700 Subject: [PATCH] Move rcgen-based tests to their own crate. Remove the `rcgen` dev-dependency from the webpki crate. --- .github/workflows/ci.yml | 10 +++++++++- Cargo.toml | 7 ++++++- rcgen-tests/Cargo.toml | 9 +++++++++ {tests => rcgen-tests/tests}/dos.rs | 12 ------------ 4 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 rcgen-tests/Cargo.toml rename {tests => rcgen-tests/tests}/dos.rs (91%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6aae98d..1e540a4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -210,6 +210,14 @@ jobs: run: | cargo test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }} + - if: ${{ !contains(matrix.host_os, 'windows') }} + run: | + mk/cargo.sh test -p rcgen-tests -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }} + + - if: ${{ contains(matrix.host_os, 'windows') }} + run: | + cargo test -vv -p rcgen-tests --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }} + coverage: runs-on: ${{ matrix.host_os }} @@ -256,7 +264,7 @@ jobs: - if: ${{ !contains(matrix.host_os, 'windows') }} run: | - RING_COVERAGE=1 mk/cargo.sh +${{ matrix.rust_channel }} test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }} + RING_COVERAGE=1 mk/cargo.sh --workspace +${{ matrix.rust_channel }} test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }} - uses: briansmith/codecov-codecov-action@v1 with: diff --git a/Cargo.toml b/Cargo.toml index 462997d0..327d158e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,6 @@ untrusted = "0.9" [dev-dependencies] base64 = "0.9.1" -rcgen = { version = "0.11.3", default-features = false } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -80,3 +79,9 @@ rpath = false lto = true debug-assertions = false codegen-units = 1 + +[workspace] +members = [ + # Intentionally not a default member. + "rcgen-tests", +] diff --git a/rcgen-tests/Cargo.toml b/rcgen-tests/Cargo.toml new file mode 100644 index 00000000..204fc43b --- /dev/null +++ b/rcgen-tests/Cargo.toml @@ -0,0 +1,9 @@ +[package] +edition = "2018" +name = "rcgen-tests" +publish = false +version = "0.10.0" + +[dev-dependencies] +rcgen = { version = "0.11.3", default-features = false } +webpki = { path = "../", default-features = false } diff --git a/tests/dos.rs b/rcgen-tests/tests/dos.rs similarity index 91% rename from tests/dos.rs rename to rcgen-tests/tests/dos.rs index 5aa8c446..e3cf9e0c 100644 --- a/tests/dos.rs +++ b/rcgen-tests/tests/dos.rs @@ -12,18 +12,6 @@ // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// XXX: rcgen can only build on archs that *ring* 0.16 supports. -#![cfg(all( - not(all(target_arch = "aarch64", target_os = "windows")), - any( - target_arch = "aarch64", - target_arch = "arm", - target_arch = "wasm32", - target_arch = "x86", - target_arch = "x86_64" - ) -))] -#![cfg(feature = "alloc")] #![no_std] extern crate alloc;