mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 19:30:43 +00:00
`xenora probe` and `xenora imports sync` defaulted to a folder named after one commercial game. Give both one shared default, `diagnostics/probe`, and ignore it in Git. Keep the old ignore rules so existing local reports stay out of commits. Closes #364 Signed-off-by: jelly013 <22855910+jelly013@users.noreply.github.com>
28 lines
985 B
Rust
28 lines
985 B
Rust
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
//! Default report folder of `xenora probe` and `xenora imports sync`.
|
|
|
|
use std::process::Command;
|
|
|
|
#[test]
|
|
fn probe_and_sync_use_the_same_default_folder() {
|
|
let fixture = concat!(
|
|
env!("CARGO_MANIFEST_DIR"),
|
|
"/../../fixtures/pe/delay-imports.exe"
|
|
);
|
|
let folder = std::env::temp_dir().join(format!("xenora-default-{}", std::process::id()));
|
|
std::fs::create_dir(&folder).unwrap();
|
|
for arguments in [&["probe", "--pe", fixture][..], &["imports", "sync"]] {
|
|
let status = Command::new(env!("CARGO_BIN_EXE_xenora"))
|
|
.args(arguments)
|
|
.current_dir(&folder)
|
|
.status()
|
|
.unwrap();
|
|
assert!(status.success(), "{arguments:?}");
|
|
}
|
|
let written = ["imports.csv", "import_backlog.md"]
|
|
.map(|name| folder.join("diagnostics/probe").join(name).is_file());
|
|
std::fs::remove_dir_all(folder).unwrap();
|
|
assert_eq!(written, [true, true]);
|
|
}
|