refactor(test): hoist duplicated test helpers into ailang-test-support
closes #60 The fixture-corpus filter (NON_PARSEABLE_FIXTURES + list_ail_fixtures) was copy-pasted across three test crates and drifted out of sync as new reject fixtures landed; the examples_dir / workspace_root path walk was reimplemented ~30 more times across the suite, under two spellings (workspace_root / ws_root). Introduce crates/ailang-test-support — a zero-dependency, dev-only leaf crate — as the single home for these helpers: - NON_PARSEABLE_FIXTURES, list_ail_fixtures - workspace_root, examples_dir - canonical_workspace_root (symlink-resolved variant, for the tsan/ race tests that feed the root into native build steps) All integration-test copies across ailang-core, ailang-surface, ailang-prose, ailang-check, and ail now import from the shared crate; the local definitions and their now-orphaned path imports are removed. Path helpers resolve via the support crate's own CARGO_MANIFEST_DIR, so they return the correct absolute paths from any caller. ail_bin helpers are intentionally left in place: they depend on env!("CARGO_BIN_EXE_ail"), which Cargo only defines when compiling the ail crate's own integration tests, so they cannot move to a shared crate. Behaviour-identical: same paths, same fixture lists; full workspace test suite green. Net -177 LOC.
This commit is contained in:
@@ -28,12 +28,8 @@
|
||||
//! build of any kernel emits `libailang_rt.a`; the C host links the
|
||||
//! runtime archive directly and never calls a kernel.
|
||||
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
|
||||
fn ws_root() -> PathBuf {
|
||||
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../..").canonicalize().unwrap()
|
||||
}
|
||||
fn ail_bin() -> &'static str { env!("CARGO_BIN_EXE_ail") }
|
||||
|
||||
/// 8 threads * 2_000_000 cycles — must match the `#define`s in
|
||||
@@ -47,7 +43,7 @@ fn global_rc_stats_counters_are_exact_under_thread_contention() {
|
||||
let outdir = std::env::temp_dir().join(format!(
|
||||
"ail-rc-global-stats-race-{}", std::process::id()));
|
||||
std::fs::create_dir_all(&outdir).unwrap();
|
||||
let root = ws_root();
|
||||
let root = ailang_test_support::canonical_workspace_root();
|
||||
|
||||
// Any kernel staticlib build emits libailang_rt.a alongside it.
|
||||
let st = Command::new(ail_bin())
|
||||
|
||||
Reference in New Issue
Block a user