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

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

Issue 5714059: code review 5714059: cmd/go: fixes for gccgo. (Closed)
Patch Set: diff -r 8592a2140513 https://go.googlecode.com/hg/ Created 13 years 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/pkg.go ('k') | no next file » | 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 // and then repeat the import path there. We tell the 417 // and then repeat the import path there. We tell the
418 // compiler and linker to look in that _test directory first. 418 // compiler and linker to look in that _test directory first.
419 // 419 //
420 // That is, if the package under test is unicode/utf8, 420 // That is, if the package under test is unicode/utf8,
421 // then the normal place to write the package archive is 421 // then the normal place to write the package archive is
422 // $WORK/unicode/utf8.a, but we write the test package archive to 422 // $WORK/unicode/utf8.a, but we write the test package archive to
423 // $WORK/unicode/utf8/_test/unicode/utf8.a. 423 // $WORK/unicode/utf8/_test/unicode/utf8.a.
424 // We write the external test package archive to 424 // We write the external test package archive to
425 // $WORK/unicode/utf8/_test/unicode/utf8_test.a. 425 // $WORK/unicode/utf8/_test/unicode/utf8_test.a.
426 testDir := filepath.Join(b.work, filepath.FromSlash(p.ImportPath+"/_test ")) 426 testDir := filepath.Join(b.work, filepath.FromSlash(p.ImportPath+"/_test "))
427 » ptestObj := buildToolchain.pkgpath(testDir, p, false) 427 » ptestObj := buildToolchain.pkgpath(testDir, p)
428 428
429 // Create the directory for the .a files. 429 // Create the directory for the .a files.
430 ptestDir, _ := filepath.Split(ptestObj) 430 ptestDir, _ := filepath.Split(ptestObj)
431 if err := b.mkdir(ptestDir); err != nil { 431 if err := b.mkdir(ptestDir); err != nil {
432 return nil, nil, nil, err 432 return nil, nil, nil, err
433 } 433 }
434 if err := writeTestmain(filepath.Join(testDir, "_testmain.go"), p); err != nil { 434 if err := writeTestmain(filepath.Join(testDir, "_testmain.go"), p); err != nil {
435 return nil, nil, nil, err 435 return nil, nil, nil, err
436 } 436 }
437 437
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 Imports: p.XTestImports, 476 Imports: p.XTestImports,
477 build: &build.Package{ 477 build: &build.Package{
478 ImportPos: p.build.XTestImportPos, 478 ImportPos: p.build.XTestImportPos,
479 }, 479 },
480 imports: append(ximports, ptest), 480 imports: append(ximports, ptest),
481 pkgdir: testDir, 481 pkgdir: testDir,
482 fake: true, 482 fake: true,
483 } 483 }
484 a := b.action(modeBuild, modeBuild, pxtest) 484 a := b.action(modeBuild, modeBuild, pxtest)
485 a.objdir = testDir + string(filepath.Separator) 485 a.objdir = testDir + string(filepath.Separator)
486 » » a.objpkg = buildToolchain.pkgpath(testDir, pxtest, false) 486 » » a.objpkg = buildToolchain.pkgpath(testDir, pxtest)
487 a.target = a.objpkg 487 a.target = a.objpkg
488 } 488 }
489 489
490 // Action for building pkg.test. 490 // Action for building pkg.test.
491 pmain = &Package{ 491 pmain = &Package{
492 Name: "main", 492 Name: "main",
493 Dir: testDir, 493 Dir: testDir,
494 GoFiles: []string{"_testmain.go"}, 494 GoFiles: []string{"_testmain.go"},
495 imports: []*Package{ptest}, 495 imports: []*Package{ptest},
496 build: &build.Package{}, 496 build: &build.Package{},
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 } 789 }
790 } 790 }
791 return matchRe.MatchString(str), nil 791 return matchRe.MatchString(str), nil
792 } 792 }
793 793
794 func main() { 794 func main() {
795 testing.Main(matchString, tests, benchmarks, examples) 795 testing.Main(matchString, tests, benchmarks, examples)
796 } 796 }
797 797
798 `)) 798 `))
OLDNEW
« no previous file with comments | « src/cmd/go/pkg.go ('k') | no next file » | no next file with comments »

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