Skip to content

Commit

Permalink
Perform build-time alerts in test suite using build-alert crate
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 27, 2023
1 parent 85d086f commit dffe82b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 78 deletions.
4 changes: 2 additions & 2 deletions tests/features/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
path = "lib.rs"

[dependencies]
syn-test-suite-feature-check = { path = "macro" }
build-alert = "0.1"

[features]
all-features = ["syn-test-suite-feature-check/all-features"]
all-features = []
17 changes: 16 additions & 1 deletion tests/features/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
syn_test_suite_feature_check::check!();
#[cfg(debug_assertions)]
build_alert::yellow! {"
NOTE: use --release
Syn's test suite has some tests that run on every source file
and test case in the rust-lang/rust repo, which can be pretty
slow in debug mode. Consider running cargo test with `--release`
to speed things up.
"}

#[cfg(not(feature = "all-features"))]
build_alert::red! {"
ERROR: use --all-features
Syn's test suite normally only works with all-features enabled.
Run again with `--all-features`, or run with `--features test`
to bypass this check.
"}
16 changes: 0 additions & 16 deletions tests/features/macro/Cargo.toml

This file was deleted.

59 changes: 0 additions & 59 deletions tests/features/macro/lib.rs

This file was deleted.

0 comments on commit dffe82b

Please sign in to comment.