2018-01-12 17:30:54 +01:00
|
|
|
// Run tests for all the remotes. Run this with package names which
|
|
|
|
// need integration testing.
|
2015-12-30 01:18:31 +01:00
|
|
|
//
|
2018-01-12 17:30:54 +01:00
|
|
|
// See the `test` target in the Makefile.
|
2015-12-30 01:18:31 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
2018-01-12 17:30:54 +01:00
|
|
|
"go/build"
|
2015-12-30 01:18:31 +01:00
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
"os/exec"
|
2018-01-12 17:30:54 +01:00
|
|
|
"path"
|
2016-04-26 09:11:37 +02:00
|
|
|
"regexp"
|
2015-12-30 01:18:31 +01:00
|
|
|
"runtime"
|
|
|
|
"strings"
|
|
|
|
"time"
|
2016-01-03 22:49:26 +01:00
|
|
|
|
2018-01-12 17:30:54 +01:00
|
|
|
_ "github.com/ncw/rclone/backend/all" // import all fs
|
2016-01-03 22:49:26 +01:00
|
|
|
"github.com/ncw/rclone/fs"
|
2018-01-12 17:30:54 +01:00
|
|
|
"github.com/ncw/rclone/fs/config"
|
|
|
|
"github.com/ncw/rclone/fs/list"
|
|
|
|
"github.com/ncw/rclone/fs/operations"
|
2016-01-24 13:37:46 +01:00
|
|
|
"github.com/ncw/rclone/fstest"
|
2015-12-30 01:18:31 +01:00
|
|
|
)
|
|
|
|
|
2017-06-07 00:04:01 +02:00
|
|
|
type remoteConfig struct {
|
|
|
|
Name string
|
|
|
|
SubDir bool
|
|
|
|
FastList bool
|
|
|
|
}
|
|
|
|
|
2015-12-30 01:18:31 +01:00
|
|
|
var (
|
2017-06-07 00:04:01 +02:00
|
|
|
remotes = []remoteConfig{
|
|
|
|
{
|
|
|
|
Name: "TestAmazonCloudDrive:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestB2:",
|
|
|
|
SubDir: true,
|
|
|
|
FastList: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestCryptDrive:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestCryptSwift:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestDrive:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestDropbox:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestGoogleCloudStorage:",
|
|
|
|
SubDir: true,
|
|
|
|
FastList: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestHubic:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestOneDrive:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestS3:",
|
|
|
|
SubDir: true,
|
|
|
|
FastList: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestSftp:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestSwift:",
|
|
|
|
SubDir: true,
|
|
|
|
FastList: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestYandex:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestFTP:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
2017-07-09 00:31:58 +02:00
|
|
|
{
|
|
|
|
Name: "TestBox:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
2017-06-26 01:47:54 +02:00
|
|
|
{
|
|
|
|
Name: "TestQingStor:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
2017-07-25 16:18:13 +02:00
|
|
|
{
|
|
|
|
Name: "TestAzureBlob:",
|
|
|
|
SubDir: true,
|
|
|
|
FastList: true,
|
|
|
|
},
|
2017-09-19 17:09:43 +02:00
|
|
|
{
|
|
|
|
Name: "TestPcloud:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
2017-10-02 21:29:23 +02:00
|
|
|
{
|
|
|
|
Name: "TestWebdav:",
|
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
|
|
|
},
|
2017-11-12 18:54:25 +01:00
|
|
|
{
|
|
|
|
Name: "TestCache:",
|
2017-12-04 16:50:59 +01:00
|
|
|
SubDir: false,
|
|
|
|
FastList: false,
|
2017-11-12 18:54:25 +01:00
|
|
|
},
|
2015-12-30 01:18:31 +01:00
|
|
|
}
|
|
|
|
// Flags
|
2016-04-26 09:11:37 +02:00
|
|
|
maxTries = flag.Int("maxtries", 5, "Number of times to try each test")
|
|
|
|
runTests = flag.String("remotes", "", "Comma separated list of remotes to test, eg 'TestSwift:,TestS3'")
|
2016-01-03 22:49:26 +01:00
|
|
|
clean = flag.Bool("clean", false, "Instead of testing, clean all left over test directories")
|
2018-01-12 17:30:54 +01:00
|
|
|
runOnly = flag.String("run", "", "Run only those tests matching the regexp supplied")
|
2017-11-29 14:51:17 +01:00
|
|
|
timeout = flag.Duration("timeout", 30*time.Minute, "Maximum time to run each test for before giving up")
|
2015-12-30 01:18:31 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// test holds info about a running test
|
|
|
|
type test struct {
|
2018-01-12 17:30:54 +01:00
|
|
|
pkg string
|
2016-04-26 09:11:37 +02:00
|
|
|
remote string
|
|
|
|
subdir bool
|
|
|
|
cmdLine []string
|
|
|
|
cmdString string
|
|
|
|
try int
|
|
|
|
err error
|
|
|
|
output []byte
|
|
|
|
failedTests []string
|
|
|
|
runFlag string
|
2015-12-30 01:18:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// newTest creates a new test
|
2018-01-12 17:30:54 +01:00
|
|
|
func newTest(pkg, remote string, subdir bool, fastlist bool) *test {
|
|
|
|
binary := pkgBinary(pkg)
|
2015-12-30 01:18:31 +01:00
|
|
|
t := &test{
|
2018-01-12 17:30:54 +01:00
|
|
|
pkg: pkg,
|
2015-12-30 01:18:31 +01:00
|
|
|
remote: remote,
|
|
|
|
subdir: subdir,
|
2018-01-12 17:30:54 +01:00
|
|
|
cmdLine: []string{binary, "-test.timeout", (*timeout).String(), "-remote", remote},
|
2015-12-30 01:18:31 +01:00
|
|
|
try: 1,
|
|
|
|
}
|
2017-08-03 20:54:08 +02:00
|
|
|
if *fstest.Verbose {
|
2015-12-30 12:34:22 +01:00
|
|
|
t.cmdLine = append(t.cmdLine, "-test.v")
|
2017-02-24 23:51:01 +01:00
|
|
|
fs.Config.LogLevel = fs.LogLevelDebug
|
2015-12-30 12:34:22 +01:00
|
|
|
}
|
2016-02-25 23:05:57 +01:00
|
|
|
if *runOnly != "" {
|
|
|
|
t.cmdLine = append(t.cmdLine, "-test.run", *runOnly)
|
|
|
|
}
|
2015-12-30 01:18:31 +01:00
|
|
|
if subdir {
|
|
|
|
t.cmdLine = append(t.cmdLine, "-subdir")
|
|
|
|
}
|
2017-06-07 00:04:01 +02:00
|
|
|
if fastlist {
|
|
|
|
t.cmdLine = append(t.cmdLine, "-fast-list")
|
|
|
|
}
|
2017-06-13 14:19:18 +02:00
|
|
|
t.cmdString = toShell(t.cmdLine)
|
2015-12-30 01:18:31 +01:00
|
|
|
return t
|
|
|
|
}
|
|
|
|
|
2016-05-07 22:19:26 +02:00
|
|
|
// dumpOutput prints the error output
|
|
|
|
func (t *test) dumpOutput() {
|
|
|
|
log.Println("------------------------------------------------------------")
|
|
|
|
log.Printf("---- %q ----", t.cmdString)
|
|
|
|
log.Println(string(t.output))
|
|
|
|
log.Println("------------------------------------------------------------")
|
|
|
|
}
|
|
|
|
|
2016-04-26 09:11:37 +02:00
|
|
|
var failRe = regexp.MustCompile(`(?m)^--- FAIL: (Test\w*) \(`)
|
|
|
|
|
|
|
|
// findFailures looks for all the tests which failed
|
|
|
|
func (t *test) findFailures() {
|
2016-05-07 22:19:26 +02:00
|
|
|
oldFailedTests := t.failedTests
|
2016-04-26 09:11:37 +02:00
|
|
|
t.failedTests = nil
|
|
|
|
for _, matches := range failRe.FindAllSubmatch(t.output, -1) {
|
|
|
|
t.failedTests = append(t.failedTests, string(matches[1]))
|
|
|
|
}
|
|
|
|
if len(t.failedTests) != 0 {
|
|
|
|
t.runFlag = "^(" + strings.Join(t.failedTests, "|") + ")$"
|
|
|
|
} else {
|
|
|
|
t.runFlag = ""
|
|
|
|
}
|
|
|
|
if t.passed() && len(t.failedTests) != 0 {
|
|
|
|
log.Printf("%q - Expecting no errors but got: %v", t.cmdString, t.failedTests)
|
2016-05-07 22:19:26 +02:00
|
|
|
t.dumpOutput()
|
2016-04-26 09:11:37 +02:00
|
|
|
} else if !t.passed() && len(t.failedTests) == 0 {
|
|
|
|
log.Printf("%q - Expecting errors but got none: %v", t.cmdString, t.failedTests)
|
2016-05-07 22:19:26 +02:00
|
|
|
t.dumpOutput()
|
|
|
|
t.failedTests = oldFailedTests
|
2016-04-26 09:11:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-13 14:19:18 +02:00
|
|
|
// nextCmdLine returns the next command line
|
|
|
|
func (t *test) nextCmdLine() []string {
|
2016-04-26 09:11:37 +02:00
|
|
|
cmdLine := t.cmdLine[:]
|
|
|
|
if t.runFlag != "" {
|
|
|
|
cmdLine = append(cmdLine, "-test.run", t.runFlag)
|
|
|
|
}
|
2017-06-13 14:19:18 +02:00
|
|
|
return cmdLine
|
|
|
|
}
|
|
|
|
|
|
|
|
// if matches then is definitely OK in the shell
|
|
|
|
var shellOK = regexp.MustCompile("^[A-Za-z0-9./_:-]+$")
|
|
|
|
|
|
|
|
// converts a argv style input into a shell command
|
|
|
|
func toShell(args []string) (result string) {
|
|
|
|
for _, arg := range args {
|
|
|
|
if result != "" {
|
|
|
|
result += " "
|
|
|
|
}
|
|
|
|
if shellOK.MatchString(arg) {
|
|
|
|
result += arg
|
|
|
|
} else {
|
|
|
|
result += "'" + arg + "'"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
// trial runs a single test
|
|
|
|
func (t *test) trial() {
|
|
|
|
cmdLine := t.nextCmdLine()
|
|
|
|
cmdString := toShell(cmdLine)
|
2016-04-26 09:11:37 +02:00
|
|
|
log.Printf("%q - Starting (try %d/%d)", cmdString, t.try, *maxTries)
|
|
|
|
cmd := exec.Command(cmdLine[0], cmdLine[1:]...)
|
2015-12-30 01:18:31 +01:00
|
|
|
start := time.Now()
|
|
|
|
t.output, t.err = cmd.CombinedOutput()
|
|
|
|
duration := time.Since(start)
|
2016-04-26 09:11:37 +02:00
|
|
|
t.findFailures()
|
2015-12-30 01:18:31 +01:00
|
|
|
if t.passed() {
|
2016-04-26 09:11:37 +02:00
|
|
|
log.Printf("%q - Finished OK in %v (try %d/%d)", cmdString, duration, t.try, *maxTries)
|
2015-12-30 01:18:31 +01:00
|
|
|
} else {
|
2016-04-26 09:11:37 +02:00
|
|
|
log.Printf("%q - Finished ERROR in %v (try %d/%d): %v: Failed %v", cmdString, duration, t.try, *maxTries, t.err, t.failedTests)
|
2015-12-30 01:18:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-03 22:49:26 +01:00
|
|
|
// cleanFs runs a single clean fs for left over directories
|
|
|
|
func (t *test) cleanFs() error {
|
|
|
|
f, err := fs.NewFs(t.remote)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2018-01-12 17:30:54 +01:00
|
|
|
entries, err := list.DirSorted(f, true, "")
|
2017-06-13 12:22:16 +02:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2017-07-05 09:38:17 +02:00
|
|
|
return entries.ForDirError(func(dir fs.Directory) error {
|
|
|
|
remote := dir.Remote()
|
|
|
|
if fstest.MatchTestRemote.MatchString(remote) {
|
|
|
|
log.Printf("Purging %s%s", t.remote, remote)
|
|
|
|
dir, err := fs.NewFs(t.remote + remote)
|
2016-01-03 22:49:26 +01:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2018-01-12 17:30:54 +01:00
|
|
|
return operations.Purge(dir)
|
2016-01-03 22:49:26 +01:00
|
|
|
}
|
2017-02-24 23:51:01 +01:00
|
|
|
return nil
|
|
|
|
})
|
2016-01-03 22:49:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// clean runs a single clean on a fs for left over directories
|
|
|
|
func (t *test) clean() {
|
|
|
|
log.Printf("%q - Starting clean (try %d/%d)", t.remote, t.try, *maxTries)
|
|
|
|
start := time.Now()
|
|
|
|
t.err = t.cleanFs()
|
|
|
|
if t.err != nil {
|
|
|
|
log.Printf("%q - Failed to purge %v", t.remote, t.err)
|
|
|
|
}
|
|
|
|
duration := time.Since(start)
|
|
|
|
if t.passed() {
|
|
|
|
log.Printf("%q - Finished OK in %v (try %d/%d)", t.cmdString, duration, t.try, *maxTries)
|
|
|
|
} else {
|
|
|
|
log.Printf("%q - Finished ERROR in %v (try %d/%d): %v", t.cmdString, duration, t.try, *maxTries, t.err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-30 01:18:31 +01:00
|
|
|
// passed returns true if the test passed
|
|
|
|
func (t *test) passed() bool {
|
|
|
|
return t.err == nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// run runs all the trials for this test
|
|
|
|
func (t *test) run(result chan<- *test) {
|
2015-12-30 12:34:22 +01:00
|
|
|
for t.try = 1; t.try <= *maxTries; t.try++ {
|
2016-01-03 22:49:26 +01:00
|
|
|
if *clean {
|
|
|
|
if !t.subdir {
|
|
|
|
t.clean()
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
t.trial()
|
|
|
|
}
|
2015-12-30 01:18:31 +01:00
|
|
|
if t.passed() {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !t.passed() {
|
2016-05-07 22:19:26 +02:00
|
|
|
t.dumpOutput()
|
2015-12-30 01:18:31 +01:00
|
|
|
}
|
|
|
|
result <- t
|
|
|
|
}
|
|
|
|
|
2018-01-12 17:30:54 +01:00
|
|
|
// GOPATH returns the current GOPATH
|
|
|
|
func GOPATH() string {
|
|
|
|
gopath := os.Getenv("GOPATH")
|
|
|
|
if gopath == "" {
|
|
|
|
gopath = build.Default.GOPATH
|
|
|
|
}
|
|
|
|
return gopath
|
|
|
|
}
|
|
|
|
|
|
|
|
// turn a package name into a binary name
|
|
|
|
func pkgBinaryName(pkg string) string {
|
|
|
|
binary := path.Base(pkg) + ".test"
|
2015-12-30 01:18:31 +01:00
|
|
|
if runtime.GOOS == "windows" {
|
|
|
|
binary += ".exe"
|
|
|
|
}
|
2018-01-12 17:30:54 +01:00
|
|
|
return binary
|
|
|
|
}
|
|
|
|
|
|
|
|
// turn a package name into a binary path
|
|
|
|
func pkgBinary(pkg string) string {
|
|
|
|
return path.Join(pkgPath(pkg), pkgBinaryName(pkg))
|
|
|
|
}
|
|
|
|
|
|
|
|
// returns the path to the package
|
|
|
|
func pkgPath(pkg string) string {
|
|
|
|
return path.Join(GOPATH(), "src", pkg)
|
|
|
|
}
|
|
|
|
|
|
|
|
// cd into the package directory
|
|
|
|
func pkgChdir(pkg string) {
|
|
|
|
err := os.Chdir(pkgPath(pkg))
|
|
|
|
if err != nil {
|
|
|
|
log.Fatalf("Failed to chdir to package %q: %v", pkg, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// makeTestBinary makes the binary we will run
|
|
|
|
func makeTestBinary(pkg string) {
|
|
|
|
binaryName := pkgBinaryName(pkg)
|
|
|
|
log.Printf("%s: Making test binary %q", pkg, binaryName)
|
|
|
|
pkgChdir(pkg)
|
|
|
|
err := exec.Command("go", "test", "-c", "-o", binaryName).Run()
|
2015-12-30 01:18:31 +01:00
|
|
|
if err != nil {
|
|
|
|
log.Fatalf("Failed to make test binary: %v", err)
|
|
|
|
}
|
2018-01-12 17:30:54 +01:00
|
|
|
binary := pkgBinary(pkg)
|
2015-12-30 01:18:31 +01:00
|
|
|
if _, err := os.Stat(binary); err != nil {
|
|
|
|
log.Fatalf("Couldn't find test binary %q", binary)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// removeTestBinary removes the binary made in makeTestBinary
|
2018-01-12 17:30:54 +01:00
|
|
|
func removeTestBinary(pkg string) {
|
|
|
|
binary := pkgBinary(pkg)
|
2015-12-30 01:18:31 +01:00
|
|
|
err := os.Remove(binary) // Delete the binary when finished
|
|
|
|
if err != nil {
|
|
|
|
log.Printf("Error removing test binary %q: %v", binary, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
2018-01-12 17:30:54 +01:00
|
|
|
packages := flag.Args()
|
|
|
|
log.Printf("Testing packages: %s", strings.Join(packages, ", "))
|
2015-12-30 01:18:31 +01:00
|
|
|
if *runTests != "" {
|
2017-06-07 00:04:01 +02:00
|
|
|
newRemotes := []remoteConfig{}
|
|
|
|
for _, name := range strings.Split(*runTests, ",") {
|
|
|
|
for i := range remotes {
|
|
|
|
if remotes[i].Name == name {
|
|
|
|
newRemotes = append(newRemotes, remotes[i])
|
|
|
|
goto found
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.Printf("Remote %q not found - inserting with default flags", name)
|
|
|
|
newRemotes = append(newRemotes, remoteConfig{Name: name})
|
|
|
|
found:
|
|
|
|
}
|
|
|
|
remotes = newRemotes
|
2015-12-30 01:18:31 +01:00
|
|
|
}
|
2017-06-07 00:04:01 +02:00
|
|
|
var names []string
|
|
|
|
for _, remote := range remotes {
|
|
|
|
names = append(names, remote.Name)
|
|
|
|
}
|
|
|
|
log.Printf("Testing remotes: %s", strings.Join(names, ", "))
|
2015-12-30 01:18:31 +01:00
|
|
|
|
|
|
|
start := time.Now()
|
2016-01-03 22:49:26 +01:00
|
|
|
if *clean {
|
2018-01-12 17:30:54 +01:00
|
|
|
config.LoadConfig()
|
2018-01-19 10:47:01 +01:00
|
|
|
packages = []string{"clean"}
|
2016-01-03 22:49:26 +01:00
|
|
|
} else {
|
2018-01-12 17:30:54 +01:00
|
|
|
for _, pkg := range packages {
|
|
|
|
makeTestBinary(pkg)
|
|
|
|
defer removeTestBinary(pkg)
|
|
|
|
}
|
2016-01-03 22:49:26 +01:00
|
|
|
}
|
2015-12-30 01:18:31 +01:00
|
|
|
|
|
|
|
// start the tests
|
|
|
|
results := make(chan *test, 8)
|
|
|
|
awaiting := 0
|
2017-09-30 12:07:09 +02:00
|
|
|
bools := []bool{false, true}
|
|
|
|
if *clean {
|
|
|
|
// Don't run -subdir and -fast-list if -clean
|
|
|
|
bools = bools[:1]
|
|
|
|
}
|
2018-01-12 17:30:54 +01:00
|
|
|
for _, pkg := range packages {
|
|
|
|
for _, remote := range remotes {
|
|
|
|
for _, subdir := range bools {
|
|
|
|
for _, fastlist := range bools {
|
|
|
|
if (!subdir || subdir && remote.SubDir) && (!fastlist || fastlist && remote.FastList) {
|
|
|
|
go newTest(pkg, remote.Name, subdir, fastlist).run(results)
|
|
|
|
awaiting++
|
|
|
|
}
|
2017-06-07 00:04:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-12-30 01:18:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Wait for the tests to finish
|
|
|
|
var failed []*test
|
|
|
|
for ; awaiting > 0; awaiting-- {
|
|
|
|
t := <-results
|
|
|
|
if !t.passed() {
|
|
|
|
failed = append(failed, t)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
duration := time.Since(start)
|
|
|
|
|
|
|
|
// Summarise results
|
2017-11-29 16:55:37 +01:00
|
|
|
log.Printf("SUMMARY")
|
2015-12-30 01:18:31 +01:00
|
|
|
if len(failed) == 0 {
|
|
|
|
log.Printf("PASS: All tests finished OK in %v", duration)
|
|
|
|
} else {
|
|
|
|
log.Printf("FAIL: %d tests failed in %v", len(failed), duration)
|
|
|
|
for _, t := range failed {
|
2017-06-13 14:19:18 +02:00
|
|
|
log.Printf(" * %s", toShell(t.nextCmdLine()))
|
2017-06-07 00:04:01 +02:00
|
|
|
log.Printf(" * Failed tests: %v", t.failedTests)
|
2015-12-30 01:18:31 +01:00
|
|
|
}
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|