From e009c002ba0206023cf3b8fb50f86877f923870e Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 13 May 2017 21:45:41 +0200 Subject: [PATCH] local: Add benchmark --- src/restic/backend/local/local_test.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/restic/backend/local/local_test.go b/src/restic/backend/local/local_test.go index ad0d626cb..d2bed6e13 100644 --- a/src/restic/backend/local/local_test.go +++ b/src/restic/backend/local/local_test.go @@ -10,8 +10,8 @@ import ( . "restic/test" ) -func TestBackend(t *testing.T) { - suite := test.Suite{ +func newTestSuite(t testing.TB) *test.Suite { + return &test.Suite{ // NewConfig returns a config for a new temporary backend that will be used in tests. NewConfig: func() (interface{}, error) { dir, err := ioutil.TempDir(TestTempDir, "restic-test-local-") @@ -50,6 +50,12 @@ func TestBackend(t *testing.T) { return nil }, } - - suite.RunTests(t) +} + +func TestBackend(t *testing.T) { + newTestSuite(t).RunTests(t) +} + +func BenchmarkBackend(t *testing.B) { + newTestSuite(t).RunBenchmarks(t) }