anthonyoteri / anthonyoteri/cargo-rigtest
Data-driven case generation from a compile-time data set (#[cases_from])
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
Follow-up to #95 (split out from the cartesian `#[values]` work in #109).
## Problem
Part A of #95 (cartesian `#[values]`) is implemented. Part B — generating one case per element of a build-time-known data set, e.g. `#[cases_from(CONST)]` over a `const CASES: &[(...)]` — was deferred because a proc macro **cannot read the contents (or length) of a referenced `const`**; it only sees the identifier token. Expanding N `TestCase` statics at compile time therefore isn't possible from a `const` reference without breaking the one-static-per-case model (which per-case naming, filtering, parallelism, and retry all depend on).
## Possible reshaped surfaces (need a design decision)
1. Accept an **inline array literal** in the attribute so the macro sees the tokens directly: `#[cases_from([("alice", 1), ("bob", 2)])]`.
2. A declarative `cases! { ... }` macro the user writes with the literal data.
3. Some codegen/build-script approach if a true external data set (e.g. per fixture file) is needed.
Blocked on choosing a surface; not implementable as literally specified in #95.
Contributor guide
Assessment
This issue has not been assessed yet.