Skip to content

Commit

Permalink
Defend --no-default-features
Browse files Browse the repository at this point in the history
This was currently broken, since one of the tests required
RSA ( = alloc feature) and real time (= std feature).
The latter is a mistake, cos tests should really be time-invariant.
  • Loading branch information
ctz committed Dec 12, 2022
1 parent 33c6614 commit 19226ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ jobs:
- # Default
- --features=alloc
- --all-features
- --no-default-features

target:
# There is no platform-specific code in webpki. Choose a handful of
Expand Down Expand Up @@ -141,6 +142,7 @@ jobs:
exclude:
- features: # Default
- features: --features=alloc
- features: --no-default-features
- features: --all-features
mode: --release
- features: --all-features
Expand All @@ -166,6 +168,12 @@ jobs:
rust_channel: stable
host_os: ubuntu-20.04

- features: --no-default-features
target: x86_64-unknown-linux-gnu
mode: # debug
rust_channel: stable
host_os: ubuntu-20.04

- features: --all-features
target: x86_64-unknown-linux-gnu
mode: --release
Expand Down
3 changes: 2 additions & 1 deletion tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ pub fn ed25519() {
}

#[test]
#[cfg(feature = "alloc")]
fn critical_extensions() {
let root = include_bytes!("critical_extensions/root-cert.der");
let ca = include_bytes!("critical_extensions/ca-cert.der");

let time = webpki::Time::try_from(std::time::SystemTime::now()).unwrap();
let time = webpki::Time::from_seconds_since_unix_epoch(1_670_779_098);
let anchors = [webpki::TrustAnchor::try_from_cert_der(root).unwrap()];
let anchors = webpki::TLSServerTrustAnchors(&anchors);

Expand Down

0 comments on commit 19226ea

Please sign in to comment.