1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Shared attribute helpers for recognising test code.
//!
//! Every analyzer that distinguishes test code from production code needs
//! the same pair of predicates over `syn::Attribute`. Hosting them here
//! keeps the rule simple (no cross-analyzer imports) and the semantics
//! uniform across IOSP, DRY, TQ, Structural, and Architecture.
/// True if `attrs` contains `#[cfg(test)]`.
/// Operation: attribute inspection logic, no own calls.
/// True if `attrs` contains a test-entry-point attribute.
///
/// Recognises the bare `#[test]` plus the common framework variants:
/// any attribute whose path ends in `test` (`#[tokio::test]`,
/// `#[async_std::test]`, `#[googletest::test]`, …) and the renamed
/// macros `#[rstest]`, `#[test_case]` and `#[quickcheck]`. Matching on
/// the last path segment keeps both bare and fully-qualified forms
/// (`#[rstest::rstest]`) in scope without an exhaustive crate list.
/// Operation: attribute inspection logic, no own calls.