go(algo_test): do test separation, proper clean-up
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-08-20 12:42:20 +02:00
parent 18d022c851
commit d397137cfc
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -22,7 +22,7 @@ func TestDoRandomSearchExec(t *testing.T) {
wg.Wait() wg.Wait()
picsDir := report.GetPicsDir() picsDir := report.GetPicsDir() + "-test-rs"
if err := os.RemoveAll(picsDir); err != nil { if err := os.RemoveAll(picsDir); err != nil {
t.Error(err) t.Error(err)
@ -33,6 +33,11 @@ func TestDoRandomSearchExec(t *testing.T) {
if _, err := os.Stat(picsDir); err == nil { if _, err := os.Stat(picsDir); err == nil {
t.Error("picsDir should have already been cleaned up") 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) { func TestDoSHCExec(t *testing.T) {
@ -42,7 +47,7 @@ func TestDoSHCExec(t *testing.T) {
wg.Wait() wg.Wait()
picsDir := report.GetPicsDir() picsDir := report.GetPicsDir() + "-test-shc"
if err := os.RemoveAll(picsDir); err != nil { if err := os.RemoveAll(picsDir); err != nil {
t.Error(err) t.Error(err)
@ -53,4 +58,9 @@ func TestDoSHCExec(t *testing.T) {
if _, err := os.Stat(picsDir); err == nil { if _, err := os.Stat(picsDir); err == nil {
t.Error("picsDir should have already been cleaned up") t.Error("picsDir should have already been cleaned up")
} }
// clean up outdir.
if err := os.RemoveAll("out"); err != nil {
t.Error(err)
}
} }