From d397137cfcb3fd49ae63f3bf02bb35bff97435f0 Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 20 Aug 2022 12:42:20 +0200 Subject: [PATCH] go(algo_test): do test separation, proper clean-up --- algo/algo_test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/algo/algo_test.go b/algo/algo_test.go index c459bc8..31d0f0b 100644 --- a/algo/algo_test.go +++ b/algo/algo_test.go @@ -22,7 +22,7 @@ func TestDoRandomSearchExec(t *testing.T) { wg.Wait() - picsDir := report.GetPicsDir() + picsDir := report.GetPicsDir() + "-test-rs" if err := os.RemoveAll(picsDir); err != nil { t.Error(err) @@ -33,6 +33,11 @@ func TestDoRandomSearchExec(t *testing.T) { if _, err := os.Stat(picsDir); err == nil { t.Error("picsDir should have already been cleaned up") } + + // clean up outdir. + if err := os.RemoveAll("out"); err != nil { + t.Error(err) + } } func TestDoSHCExec(t *testing.T) { @@ -42,7 +47,7 @@ func TestDoSHCExec(t *testing.T) { wg.Wait() - picsDir := report.GetPicsDir() + picsDir := report.GetPicsDir() + "-test-shc" if err := os.RemoveAll(picsDir); err != nil { t.Error(err) @@ -53,4 +58,9 @@ func TestDoSHCExec(t *testing.T) { if _, err := os.Stat(picsDir); err == nil { t.Error("picsDir should have already been cleaned up") } + + // clean up outdir. + if err := os.RemoveAll("out"); err != nil { + t.Error(err) + } }