Skip to content

Commit 18ad7a0

Browse files
committed
std_detect testing improvements
* Fix riscv testing. Previously the mod tests; would be looking for src/detect/os/tests.rs. * Replace a test with an unnamed const item. It is testing that no warnings are emitted. It doesn't contain any checks that need to run at runtime. Replacing the test allows removing the tidy:skip directive for test locations.
1 parent f241071 commit 18ad7a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

std_detect/src/detect/macros.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,13 @@ macro_rules! features {
131131
};
132132
}
133133

134-
#[test] //tidy:skip
135134
#[deny(unexpected_cfgs)]
136135
#[deny(unfulfilled_lint_expectations)]
137-
fn unexpected_cfgs() {
136+
const _: () = {
138137
$(
139138
check_cfg_feature!($feature, $feature_lit $(, without cfg check: $feature_cfg_check)? $(: $($target_feature_lit),*)?);
140139
)*
141-
}
140+
};
142141

143142
/// Each variant denotes a position in a bitset for a particular feature.
144143
///

std_detect/src/detect/os/riscv.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,5 @@ pub(crate) fn imply_features(mut value: cache::Initializer) -> cache::Initialize
135135
}
136136

137137
#[cfg(test)]
138+
#[path = "riscv/tests.rs"]
138139
mod tests;

0 commit comments

Comments
 (0)