pub fn measure_seed(
ctx: &Context,
seed: &str,
) -> Result<EconomicsContextSeed, String>Expand description
Measure one seed: compile its context, and count what was considered and selected.
Every file is read from disk once, however many entries name it. An entry the index
cannot resolve, or a file the disk no longer holds, is counted as unresolved rather
than silently dropped. A seed the compiler refuses (an issue the repository does not
have) is an error that starts with the seed, so that a suite can report it beside the
record. measure shares one count of every file across all its seeds; this is the
same measurement for a seed on its own.
use majordomus_cli::economics::context::measure_seed;
use majordomus_cli::synthetic::SyntheticRepository;
let repo = SyntheticRepository::small().unwrap();
let ctx = repo.context().unwrap();
let err = measure_seed(&ctx, "I9999").unwrap_err();
assert!(err.starts_with("I9999: "), "{err}");