diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 589622b5..cb0a0e2e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,7 +53,7 @@ bookworm: interruptible: true image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/bookworm:latest script: - - cargo test + - cargo test --features=subplot - if ! git diff --quiet Cargo.lock ; then echo "Cargo.lock changed. Please add the change to the corresponding commit." ; git diff ; false ; fi - if ! git diff --quiet ; then echo "The build changed the source. Please investigate." ; git diff ; fi variables: @@ -136,7 +136,7 @@ rust-stable: - rustup override set stable - *before_script_end script: - - cargo test + - cargo test --features=subplot variables: CARGO_TARGET_DIR: /target CARGO_HOME: /cargo @@ -181,7 +181,7 @@ windows-gnu-cng: script: # https://github.com/rust-lang/cargo/issues/5015 - pacman --noconfirm --needed -S mingw-w64-x86_64-openssl - - cargo test --tests --no-default-features --features crypto-cng,compression-bzip2 + - cargo test --tests --no-default-features --features crypto-cng,compression-bzip2,subplot after_script: [] # scriptlet doesn't work on Powershell variables: CFLAGS: "" # Silence some C warnings when compiling under Windows diff --git a/Cargo.toml b/Cargo.toml index 46d7f2fa..3609b02b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,7 @@ clap_mangen = "0.2" chrono = "0.4.10" sequoia-openpgp = { version = "1.13", default-features = false } sequoia-net = { version = "0.27", default-features = false } -subplot-build = "0.6.0" +subplot-build = { version = "0.6.0", optional = true } cfg-if = "1" [dev-dependencies] @@ -90,6 +90,7 @@ crypto-cng = ["sequoia-openpgp/crypto-cng"] crypto-rust = ["sequoia-openpgp/crypto-rust"] compression-bzip2 = ["sequoia-openpgp/compression-bzip2"] autocrypt = ["sequoia-autocrypt"] +subplot = ["subplot-build"] [profile.release] debug = true diff --git a/build.rs b/build.rs index 24f28311..2de9188a 100644 --- a/build.rs +++ b/build.rs @@ -13,6 +13,7 @@ fn main() { println!("cargo:rerun-if-changed=build.rs"); // Generate subplot tests. + #[cfg(feature = "subplot")] subplot_build::codegen(Path::new("sq.subplot")) .expect("failed to generate code with Subplot"); diff --git a/tests/sq-subplot.rs b/tests/sq-subplot.rs index 83dc5274..494d1c4f 100644 --- a/tests/sq-subplot.rs +++ b/tests/sq-subplot.rs @@ -1 +1,2 @@ +#![cfg(feature = "subplot")] include!(concat!(env!("OUT_DIR"), "/sq.rs"));