mirror of
https://github.com/restic/restic.git
synced 2025-08-14 00:07:53 +00:00
run_tests: Exit with error if failed tests were found
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user