Only run benchmarks with -tags benchmark

Avoids creating temp database and stuff on a normal test run
This commit is contained in:
Jakob Borg
2015-10-21 23:19:26 +02:00
parent 918ef4dff8
commit c1591a5efd
2 changed files with 15 additions and 13 deletions

View File

@@ -28,6 +28,19 @@ func init() {
const myID = 1
func genBlocks(n int) []protocol.BlockInfo {
b := make([]protocol.BlockInfo, n)
for i := range b {
h := make([]byte, 32)
for j := range h {
h[j] = byte(i + j)
}
b[i].Size = int32(i)
b[i].Hash = h
}
return b
}
func globalList(s *db.FileSet) []protocol.FileInfo {
var fs []protocol.FileInfo
s.WithGlobal(func(fi db.FileIntf) bool {