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

Side by Side Diff: src/cmd/go/test.go

Issue 68150047: all: merge NaCl branch (part 1)
Patch Set: diff -r 737d232b573b ssh://hg@bitbucket.org/davecheney/go.nacl Created 11 years, 1 month 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:
View unified diff | Download patch
« no previous file with comments | « src/cmd/go/signal_unix.go ('k') | src/cmd/go/testflag.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 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 main 5 package main
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "go/ast" 10 "go/ast"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 var testMainDeps = map[string]bool{ 286 var testMainDeps = map[string]bool{
287 // Dependencies for testmain. 287 // Dependencies for testmain.
288 "testing": true, 288 "testing": true,
289 "regexp": true, 289 "regexp": true,
290 } 290 }
291 291
292 func runTest(cmd *Command, args []string) { 292 func runTest(cmd *Command, args []string) {
293 var pkgArgs []string 293 var pkgArgs []string
294 pkgArgs, testArgs = testFlags(args) 294 pkgArgs, testArgs = testFlags(args)
295 295
296 findExecCmd() // initialize cached result
297
296 raceInit() 298 raceInit()
297 pkgs := packagesForBuild(pkgArgs) 299 pkgs := packagesForBuild(pkgArgs)
298 if len(pkgs) == 0 { 300 if len(pkgs) == 0 {
299 fatalf("no packages to test") 301 fatalf("no packages to test")
300 } 302 }
301 303
302 if testC && len(pkgs) != 1 { 304 if testC && len(pkgs) != 1 {
303 fatalf("cannot use -c flag with multiple packages") 305 fatalf("cannot use -c flag with multiple packages")
304 } 306 }
305 if testProfile && len(pkgs) != 1 { 307 if testProfile && len(pkgs) != 1 {
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 File: filepath.Join(importPath, file), 830 File: filepath.Join(importPath, file),
829 Var: fmt.Sprintf("GoCover_%d", coverIndex), 831 Var: fmt.Sprintf("GoCover_%d", coverIndex),
830 } 832 }
831 coverIndex++ 833 coverIndex++
832 } 834 }
833 return coverVars 835 return coverVars
834 } 836 }
835 837
836 // runTest is the action for running a test binary. 838 // runTest is the action for running a test binary.
837 func (b *builder) runTest(a *action) error { 839 func (b *builder) runTest(a *action) error {
838 » args := stringList(a.deps[0].target, testArgs) 840 » args := stringList(findExecCmd(), a.deps[0].target, testArgs)
839 a.testOutput = new(bytes.Buffer) 841 a.testOutput = new(bytes.Buffer)
840 842
841 if buildN || buildX { 843 if buildN || buildX {
842 b.showcmd("", "%s", strings.Join(args, " ")) 844 b.showcmd("", "%s", strings.Join(args, " "))
843 if buildN { 845 if buildN {
844 return nil 846 return nil
845 } 847 }
846 } 848 }
847 849
848 if a.failed { 850 if a.failed {
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 Mode: {{printf "%q" .CoverMode}}, 1225 Mode: {{printf "%q" .CoverMode}},
1224 Counters: coverCounters, 1226 Counters: coverCounters,
1225 Blocks: coverBlocks, 1227 Blocks: coverBlocks,
1226 CoveredPackages: {{printf "%q" .Covered}}, 1228 CoveredPackages: {{printf "%q" .Covered}},
1227 }) 1229 })
1228 {{end}} 1230 {{end}}
1229 testing.Main(matchString, tests, benchmarks, examples) 1231 testing.Main(matchString, tests, benchmarks, examples)
1230 } 1232 }
1231 1233
1232 `)) 1234 `))
OLDNEW
« no previous file with comments | « src/cmd/go/signal_unix.go ('k') | src/cmd/go/testflag.go » ('j') | no next file with comments »

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