appveyor: use run_integration_tests.go

This commit is contained in:
Alexander Neumann 2015-08-19 20:45:54 +02:00
parent 23845b071b
commit d21b782119
2 changed files with 20 additions and 4 deletions

View File

@ -4,11 +4,8 @@ environment:
GOPATH: c:\gopath;c:\gopath\src\github.com\restic\restic\Godeps\_workspace GOPATH: c:\gopath;c:\gopath\src\github.com\restic\restic\Godeps\_workspace
install: install:
- echo %PATH%
- echo %GOPATH%
- go version - go version
- go env - go env
build_script: build_script:
- go run build.go - go run run_integration_tests.go
- go test -v

View File

@ -77,6 +77,19 @@ func (env *TravisEnvironment) RunTests() {
runGofmt() runGofmt()
} }
type AppveyorEnvironment struct{}
func (env *AppveyorEnvironment) Prepare() {
msg("preparing environment for Appveyor CI\n")
// install tar, gzip, bzip2
}
func (env *AppveyorEnvironment) RunTests() {
// run the build script and the tests
run("go", "run", "build.go", "-v", "-T")
}
// findGoFiles returns a list of go source code file names below dir. // findGoFiles returns a list of go source code file names below dir.
func findGoFiles(dir string) (list []string, err error) { func findGoFiles(dir string) (list []string, err error) {
err = filepath.Walk(dir, func(name string, fi os.FileInfo, err error) error { err = filepath.Walk(dir, func(name string, fi os.FileInfo, err error) error {
@ -153,12 +166,18 @@ func isTravis() bool {
return os.Getenv("TRAVIS_BUILD_DIR") != "" return os.Getenv("TRAVIS_BUILD_DIR") != ""
} }
func isAppveyor() bool {
return runtime.GOOS == "windows"
}
func main() { func main() {
var env CIEnvironment var env CIEnvironment
switch { switch {
case isTravis(): case isTravis():
env = &TravisEnvironment{} env = &TravisEnvironment{}
case isAppveyor():
env = &AppveyorEnvironment{}
default: default:
fmt.Fprintln(os.Stderr, "unknown CI environment") fmt.Fprintln(os.Stderr, "unknown CI environment")
os.Exit(1) os.Exit(1)