From edfd86624cd6455288f2698f11b989d8d617187b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 26 Apr 2015 15:40:25 +0200 Subject: [PATCH] Fix "cleanup" flag --- backend/backend_test.go | 2 +- backend/local_test.go | 5 +---- backend/sftp_test.go | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/backend_test.go b/backend/backend_test.go index 445eb0fd4..36a91cec6 100644 --- a/backend/backend_test.go +++ b/backend/backend_test.go @@ -99,7 +99,7 @@ func testBackend(b backend.Backend, t *testing.T) { } // remove content if requested - if *testCleanup { + if *TestCleanup { for _, test := range TestStrings { id, err := backend.ParseID(test.id) OK(t, err) diff --git a/backend/local_test.go b/backend/local_test.go index d7f6eea2c..9bc903f0a 100644 --- a/backend/local_test.go +++ b/backend/local_test.go @@ -1,7 +1,6 @@ package backend_test import ( - "flag" "fmt" "io/ioutil" "testing" @@ -10,8 +9,6 @@ import ( . "github.com/restic/restic/test" ) -var testCleanup = flag.Bool("test.cleanup", true, "clean up after running tests (remove local backend directory with all content)") - func setupLocalBackend(t *testing.T) *local.Local { tempdir, err := ioutil.TempDir("", "restic-test-") OK(t, err) @@ -25,7 +22,7 @@ func setupLocalBackend(t *testing.T) *local.Local { } func teardownLocalBackend(t *testing.T, b *local.Local) { - if !*testCleanup { + if !*TestCleanup { t.Logf("leaving local backend at %s\n", b.Location()) return } diff --git a/backend/sftp_test.go b/backend/sftp_test.go index f1fa12b2b..dded89ca8 100644 --- a/backend/sftp_test.go +++ b/backend/sftp_test.go @@ -25,7 +25,7 @@ func setupSFTPBackend(t *testing.T) *sftp.SFTP { } func teardownSFTPBackend(t *testing.T, b *sftp.SFTP) { - if !*testCleanup { + if !*TestCleanup { t.Logf("leaving backend at %s\n", b.Location()) return }