1
0
mirror of https://github.com/restic/restic.git synced 2024-07-02 08:40:55 +02:00

local: Add benchmark

This commit is contained in:
Alexander Neumann 2017-05-13 21:45:41 +02:00
parent d24e0cc6cc
commit e009c002ba

View File

@ -10,8 +10,8 @@ import (
. "restic/test" . "restic/test"
) )
func TestBackend(t *testing.T) { func newTestSuite(t testing.TB) *test.Suite {
suite := test.Suite{ return &test.Suite{
// NewConfig returns a config for a new temporary backend that will be used in tests. // NewConfig returns a config for a new temporary backend that will be used in tests.
NewConfig: func() (interface{}, error) { NewConfig: func() (interface{}, error) {
dir, err := ioutil.TempDir(TestTempDir, "restic-test-local-") dir, err := ioutil.TempDir(TestTempDir, "restic-test-local-")
@ -50,6 +50,12 @@ func TestBackend(t *testing.T) {
return nil return nil
}, },
} }
}
suite.RunTests(t)
func TestBackend(t *testing.T) {
newTestSuite(t).RunTests(t)
}
func BenchmarkBackend(t *testing.B) {
newTestSuite(t).RunBenchmarks(t)
} }