Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/tests/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type TestResult = Result<(), Box<dyn std::error::Error>>;

const OUTPUT_DIR: &str = "./out/graph";
const SNAPSHOT_DIR: &str = "./tests/graph";
// Set this environment variable when Git repository output is needed for graph test debugging.
const DUMP_GRAPH_TEST_REPOS_ENV: &str = "SERIE_TEST_DUMP_GRAPH_REPOS";

#[test]
fn straight_001() -> TestResult {
Expand Down Expand Up @@ -1506,6 +1508,10 @@ fn create_output_dirs(path: &str) {
}

fn copy_git_dir(path: &Path, name: &str) {
if std::env::var_os(DUMP_GRAPH_TEST_REPOS_ENV).is_none() {
return;
}

let dst_path = format!("{OUTPUT_DIR}/{name}");
// dircpy overwrite doesn't seem to work as expected, so delete explicitly
if Path::new(&dst_path).is_dir() {
Expand Down