当前位置: 首页>>代码示例>>Golang>>正文


Golang B.SkipNow方法代码示例

本文整理汇总了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()
}
开发者ID:prataprc,项目名称:gobtree,代码行数:7,代码来源:appendkv_test.go

示例2: BenchmarkFluentdHandler

func BenchmarkFluentdHandler(b *testing.B) {
	if fluentdAddr == "" {
		b.SkipNow()
	}

	benchmarkHandler(b, NewFluentdHandler(fluentdAddr, "rglog.test"))
}
开发者ID:realglobe-Inc,项目名称:go-lib,代码行数:7,代码来源:fluentd_test.go

示例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())
		}
	}
}
开发者ID:hobinjk,项目名称:livegrep,代码行数:30,代码来源:bench_test.go

示例4: BenchmarkSyslogHandler

func BenchmarkSyslogHandler(b *testing.B) {
	if !testSyslogHandlerFlag {
		b.SkipNow()
	}

	benchmarkHandler(b, NewSyslogHandler("go-lib"))
}
开发者ID:realglobe-Inc,项目名称:go-lib,代码行数:7,代码来源:syslog_test.go

示例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()
}
开发者ID:ReanGD,项目名称:go-morph,代码行数:31,代码来源:speed_dawg_test.go

示例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)
	}
}
开发者ID:opennota,项目名称:fasthash,代码行数:9,代码来源:fasthash_benchmark_test.go

示例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)
	}
}
开发者ID:pombredanne,项目名称:rand,代码行数:11,代码来源:vec32_test.go

示例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)
	}
}
开发者ID:pombredanne,项目名称:rand,代码行数:11,代码来源:vec32_test.go

示例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
	}
}
开发者ID:AdamColton,项目名称:cyclicKey,代码行数:15,代码来源:cyclicKey_test.go

示例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()
}
开发者ID:prataprc,项目名称:gobtree,代码行数:14,代码来源:appendkv_test.go

示例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")
		}
	}
}
开发者ID:hhatto,项目名称:goroo,代码行数:14,代码来源:goroo_test.go

示例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()
}
开发者ID:thinkingo,项目名称:gocryptfs,代码行数:48,代码来源:performance_test.go

示例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())
}
开发者ID:Telmo,项目名称:ringqueue,代码行数:16,代码来源:memory_test.go

示例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()
}
开发者ID:jbreiding,项目名称:go-sync,代码行数:17,代码来源:index_bench_test.go

示例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
}
开发者ID:nullren,项目名称:kebab,代码行数:16,代码来源:kebab_test.go


注:本文中的testing.B.SkipNow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。