OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [exp/] [gotype/] [gotype_test.go] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// 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 main
6
 
7
import (
8
        "path/filepath"
9
        "runtime"
10
        "testing"
11
)
12
 
13
func runTest(t *testing.T, path, pkg string) {
14
        exitCode = 0
15
        *pkgName = pkg
16
        *recursive = false
17
 
18
        if pkg == "" {
19
                processFiles([]string{path}, true)
20
        } else {
21
                processDirectory(path)
22
        }
23
 
24
        if exitCode != 0 {
25
                t.Errorf("processing %s failed: exitCode = %d", path, exitCode)
26
        }
27
}
28
 
29
var tests = []struct {
30
        path string
31
        pkg  string
32
}{
33
        // individual files
34
        {"testdata/test1.go", ""},
35
 
36
        // directories
37
        {filepath.Join(runtime.GOROOT(), "src/pkg/go/ast"), "ast"},
38
        {filepath.Join(runtime.GOROOT(), "src/pkg/go/doc"), "doc"},
39
        {filepath.Join(runtime.GOROOT(), "src/pkg/go/token"), "scanner"},
40
        {filepath.Join(runtime.GOROOT(), "src/pkg/go/scanner"), "scanner"},
41
        {filepath.Join(runtime.GOROOT(), "src/pkg/go/parser"), "parser"},
42
        {filepath.Join(runtime.GOROOT(), "src/pkg/exp/types"), "types"},
43
}
44
 
45
func Test(t *testing.T) {
46
        for _, test := range tests {
47
                runTest(t, test.path, test.pkg)
48
        }
49
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.