當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。