本文整理汇总了Golang中testing.B.SkipNow方法的典型用法代码示例。如果您正苦于以下问题:Golang B.SkipNow方法的具体用法?Golang B.SkipNow怎么用?Golang B.SkipNow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testing.B
的用法示例。
在下文中一共展示了B.SkipNow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Benchmark_appendFetchFinish
func Benchmark_appendFetchFinish(b *testing.B) {
store := testStore(true)
defer func() {
store.Destroy()
}()
b.SkipNow()
}
示例2: BenchmarkFluentdHandler
func BenchmarkFluentdHandler(b *testing.B) {
if fluentdAddr == "" {
b.SkipNow()
}
benchmarkHandler(b, NewFluentdHandler(fluentdAddr, "rglog.test"))
}
示例3: benchmarkQuery
func benchmarkQuery(b *testing.B, q *client.Query) {
if *index == "" {
b.SkipNow()
}
c, e := NewClient("-load_index", *index)
if e != nil {
b.Fatal(e.Error())
}
for i := 0; i < b.N+1; i++ {
if i == 1 {
// Don't count the first run+setup, to make
// sure everything is primed.
b.ResetTimer()
}
if e := c.Err(); e != nil {
b.Fatalf("err: %s", e.Error())
}
s, e := c.Query(q)
if e != nil {
b.Fatalf("query: %s", e.Error())
}
for _ = range s.Results() {
}
if _, e := s.Close(); e != nil {
b.Fatalf("close: %s", e.Error())
}
}
}
示例4: BenchmarkSyslogHandler
func BenchmarkSyslogHandler(b *testing.B) {
if !testSyslogHandlerFlag {
b.SkipNow()
}
benchmarkHandler(b, NewSyslogHandler("go-lib"))
}
示例5: BenchmarkDAWG
// BenchmarkDAWG ...
func BenchmarkDAWG(b *testing.B) {
b.N = 0
initBenchCtx()
dict := loadDict(benchCtx.Words100k)
DAWG := loadDAWG()
bytesDAWG := loadBytesDAWG()
recordDAWG := loadRecordDAWG()
intDAWG := loadIntDAWG()
tests := []testOp{
{"get() (hits)", "M ops/sec", 10, 3, 5, getHitBench},
{"get() (misses)", "M ops/sec", 100, 5, 5, getMissesBench},
{"__contains__ (hits)", "M ops/sec", 10, 3, 5, containsHitBench},
{"__contains__ (misses)", "M ops/sec", 10, 3, 5, containsMissesBench},
{"items()", " ops/sec", 1, 1, 5, itemsBench},
{"keys()", " ops/sec", 1, 1, 5, keysBench},
}
fmt.Printf("\n====== Benchmarks (100k unique unicode words) =======\n\n")
for _, test := range tests {
bench(dict, " dict", test)
bench(DAWG, " DAWG", test)
bench(bytesDAWG, " BytesDAWG", test)
bench(recordDAWG, "RecordDAWG", test)
bench(intDAWG, " IntDAWG", test)
fmt.Println()
}
b.SkipNow()
}
示例6: BenchmarkHash64
func BenchmarkHash64(b *testing.B) {
if runtime.GOARCH != "amd64" {
b.SkipNow()
}
b.SetBytes(int64(len(buf)))
for i := 0; i < b.N; i++ {
Hash64(0, buf)
}
}
示例7: BenchmarkVec32AddAVX
func BenchmarkVec32AddAVX(bench *testing.B) {
if !CPU.AVX {
bench.SkipNow()
return
}
a := Vec32{1, 2, 3, 4}
b := Vec32{2, 3, 4, 5}
for n := 0; n < bench.N; n++ {
avxVec32Add(a, b)
}
}
示例8: BenchmarkVec32AddSSE2
func BenchmarkVec32AddSSE2(bench *testing.B) {
if !CPU.SSE2 {
bench.SkipNow()
return
}
a := Vec32{1, 2, 3, 4}
b := Vec32{2, 3, 4, 5}
for n := 0; n < bench.N; n++ {
sse2Vec32Add(a, b)
}
}
示例9: BenchmarkRand
// Comparison to see how much overhead the rand
// operations in BenchmarkpowMod are consuming
func BenchmarkRand(b *testing.B) {
b.SkipNow()
bt := []byte{0, 0, 0, 0}
var x uint16
for n := 0; n < b.N; n++ {
rand.Read(bt)
x = (uint16(bt[0]) << 8) + uint16(bt[1])
x = (uint16(bt[2]) << 8) + uint16(bt[3])
}
if false {
b.Log(x) //or it complains about unused x
}
}
示例10: Benchmark_appendFetchSetup
func Benchmark_appendFetchSetup(b *testing.B) {
store := testStore(true)
defer func() {
store.Close()
}()
data := "abcdefghijklmnopqrstuvwxyz " + "abcdefghijklmnopqrstuvwxyz "
data += data
data += data
for i := 0; i < maxEntries; i++ {
fposs = append(fposs, store.appendKey([]byte(data)))
}
b.SkipNow()
}
示例11: BenchmarkGQTPClient
func BenchmarkGQTPClient(b *testing.B) {
b.SkipNow()
client := NewClient("gqtp", "localhost", 10043)
params := map[string]string{
"table": "Users",
"query": "name:@Jim",
}
for n := 0; n < b.N; n++ {
result, _ := client.Call("select", params)
if len(result.RawData) == 0 {
b.Errorf("response body not found")
}
}
}
示例12: BenchmarkStreamRead
func BenchmarkStreamRead(t *testing.B) {
buf := make([]byte, 1024*1024)
t.SetBytes(int64(len(buf)))
fn := defaultPlainDir + "BenchmarkWrite"
fi, err := os.Stat(fn)
if err != nil {
t.Fatal(err)
}
mb := int(fi.Size() / 1024 / 1024)
if t.N > mb {
// Grow file so we can satisfy the test
//fmt.Printf("Growing file to %d MB... ", t.N)
f2, err := os.OpenFile(fn, os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
fmt.Println(err)
t.FailNow()
}
for h := 0; h < t.N-mb; h++ {
_, err = f2.Write(buf)
if err != nil {
fmt.Println(err)
t.FailNow()
}
}
f2.Close()
//fmt.Printf("done\n")
}
file, err := os.Open(fn)
if err != nil {
t.FailNow()
}
t.ResetTimer()
var i int
for i = 0; i < t.N; i++ {
_, err := file.Read(buf)
if err == io.EOF {
fmt.Printf("Test file too small\n")
t.SkipNow()
} else if err != nil {
fmt.Println(err)
t.FailNow()
}
}
file.Close()
}
示例13: benchmarkMemory
func benchmarkMemory(b *testing.B, q intqueue) {
b.SkipNow()
b.ReportAllocs()
b.N = 30000000
for i := 0; i < b.N; i++ {
q.add(i)
}
for i := 0; i < b.N; i++ {
q.remove()
}
b.Logf(memory())
}
示例14: BenchmarkIndexAsListBinarySearch8192
// Check how fast a sorted list of 8192 items would be
func BenchmarkIndexAsListBinarySearch8192(b *testing.B) {
b.SkipNow()
s := make([]int, 8192)
for x := 0; x < 8192; x++ {
s[x] = rand.Int()
}
sort.Ints(s)
b.StartTimer()
for x := 0; x < b.N; x++ {
sort.SearchInts(s, rand.Int())
}
b.StopTimer()
}
示例15: BenchmarkS3Put
func BenchmarkS3Put(b *testing.B) {
if testutil.SkipS3 {
b.SkipNow()
}
benchBucket = testutil.Upgrade(testutil.TempS3Bucket("BenchmarkPutS3"))
for i := 0; i < b.N; i++ {
n, err := Put(benchBucket, testutil.TempDir, []string{"data"})
if err != nil {
b.Fatalf("Put failed: %s", err)
}
b.SetBytes(n)
}
benchPutOk = true
}