summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/src/github.com/mongodb/mongo-tools/common/json/bench_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/gotools/src/github.com/mongodb/mongo-tools/common/json/bench_test.go')
-rw-r--r--src/mongo/gotools/src/github.com/mongodb/mongo-tools/common/json/bench_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/common/json/bench_test.go b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/common/json/bench_test.go
index 9ed3c014078..ba34a4015fc 100644
--- a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/common/json/bench_test.go
+++ b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/common/json/bench_test.go
@@ -18,6 +18,7 @@ package json
import (
"bytes"
"compress/gzip"
+ "github.com/mongodb/mongo-tools/common/testtype"
"io/ioutil"
"os"
"testing"
@@ -81,6 +82,7 @@ func codeInit() {
}
func BenchmarkCodeEncoder(b *testing.B) {
+ testtype.SkipUnlessBenchmarkType(b, testtype.UnitTestType)
if codeJSON == nil {
b.StopTimer()
codeInit()
@@ -96,6 +98,7 @@ func BenchmarkCodeEncoder(b *testing.B) {
}
func BenchmarkCodeMarshal(b *testing.B) {
+ testtype.SkipUnlessBenchmarkType(b, testtype.UnitTestType)
if codeJSON == nil {
b.StopTimer()
codeInit()
@@ -110,6 +113,7 @@ func BenchmarkCodeMarshal(b *testing.B) {
}
func BenchmarkCodeDecoder(b *testing.B) {
+ testtype.SkipUnlessBenchmarkType(b, testtype.UnitTestType)
if codeJSON == nil {
b.StopTimer()
codeInit()
@@ -132,6 +136,7 @@ func BenchmarkCodeDecoder(b *testing.B) {
}
func BenchmarkCodeUnmarshal(b *testing.B) {
+ testtype.SkipUnlessBenchmarkType(b, testtype.UnitTestType)
if codeJSON == nil {
b.StopTimer()
codeInit()
@@ -147,6 +152,7 @@ func BenchmarkCodeUnmarshal(b *testing.B) {
}
func BenchmarkCodeUnmarshalReuse(b *testing.B) {
+ testtype.SkipUnlessBenchmarkType(b, testtype.UnitTestType)
if codeJSON == nil {
b.StopTimer()
codeInit()
@@ -161,6 +167,7 @@ func BenchmarkCodeUnmarshalReuse(b *testing.B) {
}
func BenchmarkUnmarshalString(b *testing.B) {
+ testtype.SkipUnlessBenchmarkType(b, testtype.UnitTestType)
data := []byte(`"hello, world"`)
var s string
@@ -172,6 +179,7 @@ func BenchmarkUnmarshalString(b *testing.B) {
}
func BenchmarkUnmarshalFloat64(b *testing.B) {
+ testtype.SkipUnlessBenchmarkType(b, testtype.UnitTestType)
var f float64
data := []byte(`3.14`)
@@ -183,6 +191,7 @@ func BenchmarkUnmarshalFloat64(b *testing.B) {
}
func BenchmarkUnmarshalInt64(b *testing.B) {
+ testtype.SkipUnlessBenchmarkType(b, testtype.UnitTestType)
var x int64
data := []byte(`3`)