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

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