Another fix for run-parallel

Don't return error code 1 when some invocations return with no errors.

Change-Id: I4eec555bc188bcfaa3424dbb70a3391062ba87f6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44782
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton 2021-03-15 22:15:22 +00:00 committed by Commit Bot service account
parent 7d80c2783a
commit 1691401179
1 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ func run() error {
taskIndices := make(chan int, 64) taskIndices := make(chan int, 64)
type result struct { type result struct {
msg string msg string
success bool failed bool
} }
results := make([]result, len(perInstanceValues)) results := make([]result, len(perInstanceValues))
@ -93,7 +93,7 @@ func run() error {
} }
success, out := invoke(exe, taskArgs) success, out := invoke(exe, taskArgs)
if !success || !*onlyPrintFailures { if !success || !*onlyPrintFailures {
results[idx] = result{out, success} results[idx] = result{out, !success}
} }
} }
}() }()
@ -106,14 +106,14 @@ func run() error {
wg.Wait() wg.Wait()
success := true failed := false
for _, result := range results { for _, result := range results {
if result.msg != "" { if result.msg != "" {
fmt.Println(result.msg) fmt.Println(result.msg)
} }
success = success && result.success failed = failed || result.failed
} }
if !success { if failed {
os.Exit(1) os.Exit(1)
} }
return nil return nil