(root: &Path, home: &Path, args: &[&str])
| 42 | const ATOMIC_BIN: &str = env!("CARGO_BIN_EXE_atomic"); |
| 43 | |
| 44 | fn atomic(root: &Path, home: &Path, args: &[&str]) -> Output { |
| 45 | let mut command = Command::new(ATOMIC_BIN); |
| 46 | command.args(args); |
| 47 | // This corpus exercises ordinary-import fidelity, including symlinks, |
| 48 | // arbitrary paths and identity-preserving rename evidence. The default |
| 49 | // restricted stream has independent coverage and explicitly loses rename |
| 50 | // identity, so select the corpus's intended importer rather than broaden |
| 51 | // its contract silently when the CLI default changes. |
| 52 | if args.starts_with(&["git", "import"]) { |
| 53 | command.arg("--no-stream"); |
| 54 | } |
| 55 | command |
| 56 | .current_dir(root) |
| 57 | .env("HOME", home) |
| 58 | .env("ATOMIC_HOME", home.join(".atomic")) |
| 59 | // CB-9C hermeticity: any command that reaches the Git shadow must |
| 60 | // resolve a stable committer identity without the machine's global |
| 61 | // gitconfig (an isolated HOME has none). |
| 62 | .env("GIT_CONFIG_GLOBAL", "/dev/null") |
| 63 | .env("GIT_CONFIG_SYSTEM", "/dev/null") |
| 64 | .env("GIT_AUTHOR_NAME", "CB-9C Tests") |
| 65 | .env("GIT_AUTHOR_EMAIL", "cb9c@example.com") |
| 66 | .env("GIT_COMMITTER_NAME", "CB-9C Tests") |
| 67 | .env("GIT_COMMITTER_EMAIL", "cb9c@example.com") |
| 68 | .output() |
| 69 | .expect("run atomic") |
| 70 | } |
| 71 | |
| 72 | #[cfg(feature = "adoption-test-injection")] |
| 73 | fn atomic_env(root: &Path, home: &Path, args: &[&str], extra_env: &[(&str, &str)]) -> Output { |
no test coverage detected