Skip to content

Commit dffe82b

Browse files
committed
Perform build-time alerts in test suite using build-alert crate
1 parent 85d086f commit dffe82b

File tree

4 files changed

+18
-78
lines changed

4 files changed

+18
-78
lines changed

tests/features/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ publish = false
99
path = "lib.rs"
1010

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

1414
[features]
15-
all-features = ["syn-test-suite-feature-check/all-features"]
15+
all-features = []

tests/features/lib.rs

+16-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
syn_test_suite_feature_check::check!();
1+
#[cfg(debug_assertions)]
2+
build_alert::yellow! {"
3+
NOTE: use --release
4+
Syn's test suite has some tests that run on every source file
5+
and test case in the rust-lang/rust repo, which can be pretty
6+
slow in debug mode. Consider running cargo test with `--release`
7+
to speed things up.
8+
"}
9+
10+
#[cfg(not(feature = "all-features"))]
11+
build_alert::red! {"
12+
ERROR: use --all-features
13+
Syn's test suite normally only works with all-features enabled.
14+
Run again with `--all-features`, or run with `--features test`
15+
to bypass this check.
16+
"}

tests/features/macro/Cargo.toml

-16
This file was deleted.

tests/features/macro/lib.rs

-59
This file was deleted.

0 commit comments

Comments
 (0)