Skip to content

Commit 599c468

Browse files
committed
[test] Migrate from trybuild to ui-test
Closes #187 gherrit-pr-id: Gbc6b00b4dee88c0d25be0b277998861157eccda7
1 parent d296c26 commit 599c468

File tree

4,982 files changed

+1890005
-70659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,982 files changed

+1890005
-70659
lines changed

Cargo.lock

Lines changed: 0 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
# paths that are stable regardless of the path to the repository root. This
1111
# avoids issues like:
1212
# https://github.com/dtolnay/trybuild/issues/207#issuecomment-131227.594
13-
[workspace]
13+
[[test]]
14+
name = "ui"
15+
path = "tests/ui.rs"
16+
harness = false
1417

18+
[workspace]
19+
members = []
1520
[package]
1621
edition = "2021"
1722
name = "zerocopy"
@@ -128,10 +133,5 @@ rand = { version = "0.8.5", default-features = false, features = ["small_rng"] }
128133
rustversion = "1.0"
129134
static_assertions = "1.1"
130135
testutil = { path = "testutil" }
131-
# Pinned to a specific version so that the version used for local development
132-
# and the version used in CI are guaranteed to be the same. Future versions
133-
# sometimes change the output format slightly, so a version mismatch can cause
134-
# CI test failures.
135-
trybuild = { version = "=1.0.89", features = ["diff"] }
136136
# In tests, unlike in production, zerocopy-derive is not optional
137137
zerocopy-derive = { version = "=0.8.38", path = "zerocopy-derive" }

ci/check_fmt.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ if [[ -z $files ]]
1515
then
1616
exit 1
1717
fi
18-
./cargo.sh +nightly fmt --check -- $files >&2
18+
19+
if [[ "$1" == "--fix" ]]; then
20+
FMT_FLAGS=""
21+
else
22+
FMT_FLAGS="--check"
23+
fi
24+
25+
./cargo.sh +nightly fmt $FMT_FLAGS -- $files >&2

ci/check_stale_stderr.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,16 @@ for dir in "${DIRS[@]}"; do
2323

2424
# Find all .stderr files
2525
while IFS= read -r -d '' stderr_file; do
26+
# Strip .stderr extension
27+
base="${stderr_file%.stderr}"
28+
29+
# Strip toolchain suffixes
30+
base="${base%.msrv}"
31+
base="${base%.stable}"
32+
base="${base%.nightly}"
33+
2634
# Construct the corresponding .rs file path
27-
rs_file="${stderr_file%.stderr}.rs"
35+
rs_file="${base}.rs"
2836

2937
# Check if the .rs file exists. The `-e` flag checks if file exists:
3038
# It returns true for regular files and valid symlinks, and false for

tests/trybuild.rs

Lines changed: 0 additions & 55 deletions
This file was deleted.

tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/ui-msrv/diagnostic-not-implemented-from-bytes.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/ui-msrv/diagnostic-not-implemented-from-zeros.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/ui-msrv/diagnostic-not-implemented-immutable.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)