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

Delta Between Two Patch Sets: src/pkg/go/build/build_test.go

Issue 4433047: code review 4433047: go/build: new package for building go programs (Closed)
Left Patch Set: diff -r ab386ee780c0 https://go.googlecode.com/hg/ Created 13 years, 11 months ago
Right Patch Set: diff -r d9401fa9dc01 https://go.googlecode.com/hg/ Created 13 years, 10 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/go/build/build.go ('k') | src/pkg/go/build/cgotest/file.go » ('j') | 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 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package build
6
7 import (
8 "os"
9 "path/filepath"
10 "runtime"
11 "testing"
12 )
13
14 var buildDirs = []string{
15 "pkg/path",
16 "cmd/gofix",
17 "pkg/big",
18 "pkg/go/build/cgotest",
19 }
20
21 func TestBuild(t *testing.T) {
22 out, err := filepath.Abs("_test/out")
23 if err != nil {
24 t.Fatal(err)
25 }
26 for _, d := range buildDirs {
27 dir := filepath.Join(runtime.GOROOT(), "src", d)
28 testBuild(t, dir, out)
29 }
30 }
31
32 func testBuild(t *testing.T, dir, targ string) {
33 d, err := ScanDir(dir, true)
34 if err != nil {
35 t.Error(err)
36 return
37 }
38 defer os.Remove(targ)
39 cmds, err := d.Build(targ)
40 if err != nil {
41 t.Error(err)
42 return
43 }
44 for _, c := range cmds {
45 t.Log("Run:", c)
46 err = c.Run(dir)
47 if err != nil {
48 t.Error(c, err)
49 return
50 }
51 }
52 }
LEFTRIGHT

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