diff --git a/src/tests/graph.rs b/src/tests/graph.rs index d454931..e8f1b53 100644 --- a/src/tests/graph.rs +++ b/src/tests/graph.rs @@ -13,6 +13,8 @@ type TestResult = Result<(), Box>; 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 { @@ -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() {