Fix "cleanup" flag

This commit is contained in:
Alexander Neumann 2015-04-26 15:40:25 +02:00
parent d19b23d4f1
commit edfd86624c
3 changed files with 3 additions and 6 deletions

View File

@ -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)

View File

@ -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
}

View File

@ -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
}