#[cfg(feature = "full-tests")]
#[path = "receive_post_callback.rs"]
mod receive_post_callback;
#[cfg(feature = "full-tests")]
#[path = "shallow_stateless_v0.rs"]
mod shallow_stateless_v0;
#[path = "spawn_guard.rs"]
mod spawn_guard;
#[path = "upload_pack_v0_multi_ack_detailed.rs"]
mod upload_pack_v0_multi_ack_detailed;
#[test]
fn every_test_file_is_compiled() {
let entry = include_str!("integration.rs");
let manifest = include_str!("../Cargo.toml");
let dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("tests");
let mut missing = Vec::new();
for item in std::fs::read_dir(&dir).expect("read tests/") {
let name = item.expect("tests/ entry").file_name();
let Some(name) = name.to_str() else { continue };
if !name.ends_with(".rs") || name == "integration.rs" || name.ends_with("_data.rs") {
continue;
}
let module = format!("#[path = \"{name}\"]");
let target = format!("path = \"tests/{name}\"");
if !entry.contains(&module) && !manifest.contains(&target) {
missing.push(name.to_owned());
}
}
missing.sort();
assert!(
missing.is_empty(),
"tests/{missing:?} would never be built: run `python3 scripts/sync_integration_tests.py` \
to add them to tests/integration.rs, or give one a [[test]] entry in Cargo.toml \
if it must run in its own process"
);
}