mirror of
https://github.com/octoleo/restic.git
synced 2024-11-29 16:23:59 +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")
|
fmt.Fprintln(file, "mode: set")
|
||||||
|
|
||||||
|
failedTests := false
|
||||||
for _, dir := range dirs {
|
for _, dir := range dirs {
|
||||||
err := filepath.Walk(dir,
|
err := filepath.Walk(dir,
|
||||||
func(p string, fi os.FileInfo, e error) error {
|
func(p string, fi os.FileInfo, e error) error {
|
||||||
@ -169,10 +170,15 @@ func main() {
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "walk(%q): %v\n", dir, err)
|
fmt.Fprintf(os.Stderr, "walk(%q): %v\n", dir, err)
|
||||||
|
failedTests = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = file.Close()
|
err = file.Close()
|
||||||
|
|
||||||
fmt.Printf("coverprofile: %v\n", file.Name())
|
fmt.Printf("coverprofile: %v\n", file.Name())
|
||||||
|
|
||||||
|
if failedTests {
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user