Skip to content

Commit

Permalink
[miri] Skip running UI tests (#400)
Browse files Browse the repository at this point in the history
Mark UI tests as `#[cfg_attr(miri, ignore)]`. In CI, remove `-- --skip
ui` from our Miri invocation.
  • Loading branch information
joshlf authored Sep 19, 2023
1 parent da4c3cc commit 94f3f03
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,11 @@ jobs:
# Run under both the stacked borrows model (default) and under the tree
# borrows model to ensure we're compliant with both.
for EXTRA_FLAGS in "" "-Zmiri-tree-borrows"; do
# Skip the `ui` test since it invokes the compiler, which we can't do
# from Miri (and wouldn't want to do anyway).
MIRIFLAGS="$MIRIFLAGS $EXTRA_FLAGS" ./cargo.sh +${{ matrix.toolchain }} \
miri test \
--package ${{ matrix.crate }} \
--target ${{ matrix.target }} \
${{ matrix.features }} \
-- --skip ui
${{ matrix.features }}
done
# Only nightly has a working Miri, so we skip installing on all other
# toolchains.
Expand Down
2 changes: 2 additions & 0 deletions tests/trybuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const SOURCE_FILES_DIR: &str = "tests/ui-stable";
const SOURCE_FILES_DIR: &str = "tests/ui-msrv";

#[test]
#[cfg_attr(miri, ignore)]
fn ui() {
let t = trybuild::TestCases::new();
t.compile_fail(format!("{SOURCE_FILES_DIR}/*.rs"));
Expand All @@ -37,6 +38,7 @@ fn ui() {
// tests the correct behavior when the "derive" feature is enabled.
#[cfg(feature = "derive")]
#[test]
#[cfg_attr(miri, ignore)]
fn ui_invalid_impls() {
let t = trybuild::TestCases::new();
t.compile_fail(format!("{SOURCE_FILES_DIR}/invalid-impls/*.rs"));
Expand Down
1 change: 1 addition & 0 deletions zerocopy-derive/tests/trybuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const SOURCE_FILES_GLOB: &str = "tests/ui-stable/*.rs";
const SOURCE_FILES_GLOB: &str = "tests/ui-msrv/*.rs";

#[test]
#[cfg_attr(miri, ignore)]
fn ui() {
let t = trybuild::TestCases::new();
t.compile_fail(SOURCE_FILES_GLOB);
Expand Down

0 comments on commit 94f3f03

Please sign in to comment.