Skip to content

Commit

Permalink
tests: run trybuild tests known to be broken on nightly only on stable
Browse files Browse the repository at this point in the history
  • Loading branch information
decathorpe committed Jul 13, 2024
1 parent be243e0 commit e886abb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,13 @@ jobs:
command: check
args: --workspace --verbose --all-features --tests --examples

# only run trybuild tests with stable Rust

- name: Run "cargo test" (with trybuild tests)
- name: Run "cargo test"
uses: actions-rs/cargo@v1
if: ${{ matrix.rust == 'stable' }}
with:
toolchain: ${{ matrix.rust }}
command: test
args: --workspace --verbose --all-features

- name: Run "cargo test" (without trybuild tests)
uses: actions-rs/cargo@v1
if: ${{ matrix.rust != 'stable' }}
with:
toolchain: ${{ matrix.rust }}
command: test
args: --workspace --verbose --all-features -- --skip try_build

clippy:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dxr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ thiserror = "1.0.30"
chrono = { version = "0.4.19", features = ["clock", "std"], default-features = false }
quickcheck = "1.0"
quickcheck_macros = "1.0"
rustversion = "1"
trybuild = "1"

[features]
Expand Down
10 changes: 10 additions & 0 deletions dxr/tests/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fn try_build_pass() {
t.pass("tests/trybuild/collections.rs");
}

#[rustversion::stable]
#[test]
fn try_build_fail() {
let t = trybuild::TestCases::new();
Expand All @@ -18,3 +19,12 @@ fn try_build_fail() {
t.compile_fail("tests/trybuild/tuple.rs");
t.compile_fail("tests/trybuild/enum.rs");
}

#[rustversion::nightly]
#[test]
fn try_build_fail() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/trybuild/slice.rs");
t.compile_fail("tests/trybuild/tuple.rs");
t.compile_fail("tests/trybuild/enum.rs");
}

0 comments on commit e886abb

Please sign in to comment.