Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gate tests behind the features they use #944

Merged

Conversation

alexanderkjall
Copy link
Contributor

this enables running 'cargo test --no-default-features'

We use a similar patch in Debian to make our CI/CD happy: https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/x11rb-protocol/debian/patches/gate-tests-on-std.patch?ref_type=heads

this enables running 'cargo test --no-default-features'
@psychon
Copy link
Owner

psychon commented Nov 2, 2024

If this is needed, I think we should make sure that this keeps working. Do you think this patch would work for that?

diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index edd3bce2..d259c64c 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -105,9 +105,9 @@ jobs:
     - name: cargo build with all features
       run: cargo build --workspace --verbose --all-targets --all-features
 
-    # build no_std
+    # test no_std
     - name: cargo build protocol with no default features
-      run: cargo build --manifest-path x11rb-protocol/Cargo.toml --no-default-features --features=all-extensions
+      run: cargo test --manifest-path x11rb-protocol/Cargo.toml --no-default-features --features=all-extensions
 
     - name: Add rustflag for instrument coverage
       if: matrix.rust == 'nightly'

Edit: And the name should also be fixed for this change

@alexanderkjall
Copy link
Contributor Author

that seems reasonable, but I'm no expert on your build system :)

Should I include it in this PR?

@mergify mergify bot merged commit 4c2330b into psychon:master Nov 7, 2024
11 checks passed
@psychon psychon mentioned this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants