mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
run_tests: Exit with error if failed tests were found
This commit is contained in:
parent
c410cd5584
commit
d9a8dcfd67
@ -145,6 +145,7 @@ func main() {
|
||||
|
||||
fmt.Fprintln(file, "mode: set")
|
||||
|
||||
failedTests := false
|
||||
for _, dir := range dirs {
|
||||
err := filepath.Walk(dir,
|
||||
func(p string, fi os.FileInfo, e error) error {
|
||||
@ -169,10 +170,15 @@ func main() {
|
||||
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "walk(%q): %v\n", dir, err)
|
||||
failedTests = true
|
||||
}
|
||||
}
|
||||
|
||||
err = file.Close()
|
||||
|
||||
fmt.Printf("coverprofile: %v\n", file.Name())
|
||||
|
||||
if failedTests {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user