From 1691401179376a45eaab52de47c5c11a34235186 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 15 Mar 2021 22:15:22 +0000 Subject: [PATCH] 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 Commit-Queue: Antonio Maiorano Reviewed-by: Antonio Maiorano --- tools/run-parallel/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/run-parallel/main.go b/tools/run-parallel/main.go index 98bc59baca..bab82a2408 100644 --- a/tools/run-parallel/main.go +++ b/tools/run-parallel/main.go @@ -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