Skip to content

Commit

Permalink
[ci] Don't skip UI tests on zerocopy-derive. (#797)
Browse files Browse the repository at this point in the history
This had been done as a workaround for `byteorder` changing error
messages, but `byteorder` is no longer a feature.
  • Loading branch information
jswrenn committed Jan 21, 2024
1 parent c5ab376 commit 80228e8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 90 deletions.
49 changes: 31 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,31 +162,44 @@ jobs:
-- \
--skip ui
if [ "${{ matrix.features }}" != "--no-default-features" -a "${{ matrix.features }}" != "" ]; then
# Run UI tests separately, treating warnings as warnings (rather than
# as errors, as we do everywhere else in our CI tests). This allows
# our UI tests to more accurately reflect what users will see, and
# also ensures that we're not spuriously relying on warnings being
# errors to ensure compilation failure (if we were, then our code
# would be unsound whenever -Dwarnings is not enabled).
#
# TODO(#560), TODO(#187): Once we migrate to the ui-test crate, we
# likely won't have to special-case the UI tests like this.
RUSTFLAGS="$RUSTFLAGS -Wwarnings" ./cargo.sh +${{ matrix.toolchain }} test \
--package ${{ matrix.crate }} \
--target ${{ matrix.target }} \
${{ matrix.features }} \
--verbose \
ui
fi
# Only run tests when targetting x86 (32- or 64-bit) - we're executing on
# x86_64, so we can't run tests for any non-x86 target.
#
# TODO(https://github.com/dtolnay/trybuild/issues/184#issuecomment-1269097742):
# Run compile tests when building for other targets.
if: contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')

- name: Run UI tests
run: |
# Run UI tests separately, treating warnings as warnings (rather than
# as errors, as we do everywhere else in our CI tests). This allows
# our UI tests to more accurately reflect what users will see, and
# also ensures that we're not spuriously relying on warnings being
# errors to ensure compilation failure (if we were, then our code
# would be unsound whenever -Dwarnings is not enabled).
#
# TODO(#560), TODO(#187): Once we migrate to the ui-test crate, we
# likely won't have to special-case the UI tests like this.
RUSTFLAGS="$RUSTFLAGS -Wwarnings" ./cargo.sh +${{ matrix.toolchain }} test \
--package ${{ matrix.crate }} \
--target ${{ matrix.target }} \
${{ matrix.features }} \
--verbose \
ui
# Only run tests when targetting x86 (32- or 64-bit) - we're executing on
# x86_64, so we can't run tests for any non-x86 target.
#
# TODO(https://github.com/dtolnay/trybuild/issues/184#issuecomment-1269097742):
# Run compile tests when building for other targets.
#
# Only run UI tests for zerocopy-derive, or for zerocopy with the derive
# feature.
if: |
(contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')) &&
(matrix.crate == 'zerocopy-derive' ||
(matrix.features != '' && matrix.features != '--no-default-features'))
- name: Run tests under Miri
run: |
# Work around https://github.com/rust-lang/miri/issues/3125
Expand Down
24 changes: 0 additions & 24 deletions zerocopy-derive/tests/ui-msrv/struct.stderr
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-msrv/struct.rs:70:8
|
70 | #[repr(packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-msrv/struct.rs:76:8
|
76 | #[repr(packed(1))]
| ^^^^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-msrv/struct.rs:82:11
|
82 | #[repr(C, packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-msrv/struct.rs:88:11
|
88 | #[repr(C, packed(1))]
| ^^^^^^^^^

error: unsupported on generic structs that are not repr(transparent) or repr(packed)
--> tests/ui-msrv/struct.rs:97:10
|
Expand Down
24 changes: 0 additions & 24 deletions zerocopy-derive/tests/ui-nightly/struct.stderr
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-nightly/struct.rs:70:8
|
70 | #[repr(packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-nightly/struct.rs:76:8
|
76 | #[repr(packed(1))]
| ^^^^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-nightly/struct.rs:82:11
|
82 | #[repr(C, packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-nightly/struct.rs:88:11
|
88 | #[repr(C, packed(1))]
| ^^^^^^^^^

error: unsupported on generic structs that are not repr(transparent) or repr(packed)
--> tests/ui-nightly/struct.rs:97:10
|
Expand Down
24 changes: 0 additions & 24 deletions zerocopy-derive/tests/ui-stable/struct.stderr
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-stable/struct.rs:70:8
|
70 | #[repr(packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-stable/struct.rs:76:8
|
76 | #[repr(packed(1))]
| ^^^^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-stable/struct.rs:82:11
|
82 | #[repr(C, packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-stable/struct.rs:88:11
|
88 | #[repr(C, packed(1))]
| ^^^^^^^^^

error: unsupported on generic structs that are not repr(transparent) or repr(packed)
--> tests/ui-stable/struct.rs:97:10
|
Expand Down

0 comments on commit 80228e8

Please sign in to comment.