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
38
39
40
41
//! Shared helpers for integration tests in `crates/vernier-core/tests/`.
//!
//! Cargo treats top-level files in `tests/` as separate binaries, so
//! per-test boilerplate (path resolution, fixture loading) duplicates
//! by default. This module collects the helpers that have grown copies
//! across `tide_oracle_parity.rs`, `tide_fp_iou_histogram.rs`, and
//! `confusion_matrix.rs`, all of which read fixtures from the Python
//! tree at `tests/python/oracle/tide/`. Renaming or relocating that
//! tree breaks every consumer here in lockstep — see
//! `tests/python/oracle/tide/fixtures/README.md` for the signpost.
//!
//! `mod common;` lives in each test binary that needs these helpers.
//! The `dead_code` allow is needed because not every binary uses every
//! helper (cargo lints unused mod items per binary).
use PathBuf;
/// Resolve a fixture file path under `tests/python/oracle/tide/fixtures/<name>/<file>`.
///
/// Tests live at `crates/vernier-core/tests/`; the oracle fixtures
/// are at the workspace root, two directories up.
pub
/// Resolve an expected-output path under `tests/python/oracle/tide/expected/<name>.json`.
///
/// Same JSON files are consumed by `tests/python/oracle/tide/test_oracle.py`;
/// see that file's `_load_expected` helper for the Python side.
pub