LEFT | RIGHT |
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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 a.objpkg = ptestObj | 467 a.objpkg = ptestObj |
468 a.target = ptestObj | 468 a.target = ptestObj |
469 a.link = false | 469 a.link = false |
470 } else { | 470 } else { |
471 ptest = p | 471 ptest = p |
472 } | 472 } |
473 | 473 |
474 // External test package. | 474 // External test package. |
475 if len(p.XTestGoFiles) > 0 { | 475 if len(p.XTestGoFiles) > 0 { |
476 pxtest = &Package{ | 476 pxtest = &Package{ |
477 » » » Name: p.Name + "_test", | 477 » » » Name: p.Name + "_test", |
478 » » » ImportPath: p.ImportPath + "_test", | 478 » » » ImportPath: p.ImportPath + "_test", |
479 localPrefix: p.localPrefix, | 479 localPrefix: p.localPrefix, |
480 » » » Dir: p.Dir, | 480 » » » Dir: p.Dir, |
481 » » » GoFiles: p.XTestGoFiles, | 481 » » » GoFiles: p.XTestGoFiles, |
482 » » » Imports: p.XTestImports, | 482 » » » Imports: p.XTestImports, |
483 build: &build.Package{ | 483 build: &build.Package{ |
484 ImportPos: p.build.XTestImportPos, | 484 ImportPos: p.build.XTestImportPos, |
485 }, | 485 }, |
486 imports: append(ximports, ptest), | 486 imports: append(ximports, ptest), |
487 pkgdir: testDir, | 487 pkgdir: testDir, |
488 fake: true, | 488 fake: true, |
489 Stale: true, | 489 Stale: true, |
490 } | 490 } |
491 computeStale(pxtest) | 491 computeStale(pxtest) |
492 a := b.action(modeBuild, modeBuild, pxtest) | 492 a := b.action(modeBuild, modeBuild, pxtest) |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 } | 800 } |
801 } | 801 } |
802 return matchRe.MatchString(str), nil | 802 return matchRe.MatchString(str), nil |
803 } | 803 } |
804 | 804 |
805 func main() { | 805 func main() { |
806 testing.Main(matchString, tests, benchmarks, examples) | 806 testing.Main(matchString, tests, benchmarks, examples) |
807 } | 807 } |
808 | 808 |
809 `)) | 809 `)) |
LEFT | RIGHT |