Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 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 // Package testing provides support for automated testing of Go packages. | 5 // Package testing provides support for automated testing of Go packages. |
6 // It is intended to be used in concert with the ``gotest'' utility, which autom ates | 6 // It is intended to be used in concert with the ``gotest'' utility, which autom ates |
7 // execution of any function of the form | 7 // execution of any function of the form |
8 // func TestXxx(*testing.T) | 8 // func TestXxx(*testing.T) |
9 // where Xxx can be any alphanumeric string (but the first letter must not be in | 9 // where Xxx can be any alphanumeric string (but the first letter must not be in |
10 // [a-z]) and serves to identify the test routine. | 10 // [a-z]) and serves to identify the test routine. |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 out := <-t.ch | 230 out := <-t.ch |
231 if out == nil { // Parallel run. | 231 if out == nil { // Parallel run. |
232 numParallel++ | 232 numParallel++ |
233 continue | 233 continue |
234 } | 234 } |
235 report(t) | 235 report(t) |
236 ok = ok && !out.failed | 236 ok = ok && !out.failed |
237 } | 237 } |
238 | 238 |
239 running := 0 | 239 running := 0 |
240 » » for numParallel + running > 0 { | 240 » » for numParallel+running > 0 { |
241 if running < *parallel && numParallel > 0 { | 241 if running < *parallel && numParallel > 0 { |
242 startParallel <- true | 242 startParallel <- true |
243 running++ | 243 running++ |
244 » » » » numParallel -- | 244 » » » » numParallel-- |
r
2011/10/06 03:33:31
did this run through gofmt? there's a space before
tebeka
2011/10/06 16:49:11
Done.
| |
245 continue | 245 continue |
246 } | 246 } |
247 t := <-ch | 247 t := <-ch |
248 report(t) | 248 report(t) |
249 ok = ok && !t.failed | 249 ok = ok && !t.failed |
250 running-- | 250 running-- |
251 } | 251 } |
252 } | 252 } |
253 | 253 |
254 if !ok { | 254 if !ok { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 for _, val := range strings.Split(*cpuListStr, ",") { | 325 for _, val := range strings.Split(*cpuListStr, ",") { |
326 cpu, err := strconv.Atoi(val) | 326 cpu, err := strconv.Atoi(val) |
327 if err != nil || cpu <= 0 { | 327 if err != nil || cpu <= 0 { |
328 println("invalid value for -test.cpu") | 328 println("invalid value for -test.cpu") |
329 os.Exit(1) | 329 os.Exit(1) |
330 } | 330 } |
331 cpuList = append(cpuList, cpu) | 331 cpuList = append(cpuList, cpu) |
332 } | 332 } |
333 } | 333 } |
334 } | 334 } |
LEFT | RIGHT |