Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Delta Between Two Patch Sets: src/pkg/runtime/runtime_test.go

Issue 5279048: code review 5279048: runtime: faster and more scalable GC (Closed)
Left Patch Set: diff -r dca37ec4ec50 https://go.googlecode.com/hg/ Created 13 years, 4 months ago
Right Patch Set: diff -r f44057cc01b2 https://go.googlecode.com/hg/ Created 12 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/runtime/runtime.c ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Calls test functions from C runtime (the tests are specified in export_test.g o).
6
5 package runtime_test 7 package runtime_test
6 8
7 import ( 9 import (
10 "fmt"
8 "io" 11 "io"
12 "runtime"
9 "testing" 13 "testing"
10 ) 14 )
11 15
12 var errf error 16 var errf error
13 17
14 func errfn() error { 18 func errfn() error {
15 return errf 19 return errf
16 } 20 }
17 21
18 func errfn1() error { 22 func errfn1() error {
(...skipping 12 matching lines...) Expand all
31 35
32 func BenchmarkIfaceCmpNil100(b *testing.B) { 36 func BenchmarkIfaceCmpNil100(b *testing.B) {
33 for i := 0; i < b.N; i++ { 37 for i := 0; i < b.N; i++ {
34 for j := 0; j < 100; j++ { 38 for j := 0; j < 100; j++ {
35 if errfn1() == nil { 39 if errfn1() == nil {
36 b.Fatal("bad comparison") 40 b.Fatal("bad comparison")
37 } 41 }
38 } 42 }
39 } 43 }
40 } 44 }
45
46 func TestAtomic64(t *testing.T) {
47 testCRuntime(t, runtime.CTestAtomic64)
48 }
49
50 func TestLockFreeStack(t *testing.T) {
51 testCRuntime(t, runtime.CTestLockFreeStack)
52 }
53
54 func TestLockFreeStackStress(t *testing.T) {
55 testCRuntime(t, runtime.CTestLockFreeStackStress)
56 }
57
58 func TestParfor(t *testing.T) {
59 testCRuntime(t, runtime.CTestParfor)
60 }
61
62 func TestParforSetup(t *testing.T) {
63 testCRuntime(t, runtime.CTestParforSetup)
64 }
65
66 func TestParforNonblock(t *testing.T) {
67 testCRuntime(t, runtime.CTestParforNonblock)
68 }
69
70 func TestParforParallel(t *testing.T) {
71 testCRuntime(t, runtime.CTestParforParallel)
72 }
73
74 func TestGcprocs(t *testing.T) {
75 testCRuntime(t, runtime.CTestGcprocs)
76 }
77
78 func testCRuntime(t *testing.T, body func(bool)) {
79 // The tests report errors via panic.
80 defer func() {
81 if msg := recover(); msg != nil {
82 where := "???"
83 // skip panic() and panicstring()
84 _, file, line, ok := runtime.Caller(3)
85 if ok {
86 where = fmt.Sprintf("%s:%d", file, line)
87 }
88 t.Fatalf("%s\nat %s", msg, where)
89 }
90 }()
91 body(testing.Short())
92 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b