diff --git a/src/reader/wgsl/parser_impl_function_header_test.cc b/src/reader/wgsl/parser_impl_function_header_test.cc index 78846135ab..9ab73193b5 100644 --- a/src/reader/wgsl/parser_impl_function_header_test.cc +++ b/src/reader/wgsl/parser_impl_function_header_test.cc @@ -43,7 +43,7 @@ TEST_F(ParserImplTest, FunctionHeader_DecoratedReturnType) { EXPECT_EQ(f->name, "main"); EXPECT_EQ(f->params.size(), 0u); EXPECT_TRUE(f->return_type->Is()); - ASSERT_TRUE(f->return_type_decorations.size() == 1u); + ASSERT_EQ(f->return_type_decorations.size(), 1u); auto* loc = f->return_type_decorations[0]->As(); ASSERT_TRUE(loc != nullptr); EXPECT_EQ(loc->value(), 1u); diff --git a/tools/run-parallel/main.go b/tools/run-parallel/main.go index 4fd3e48ee1..98bc59baca 100644 --- a/tools/run-parallel/main.go +++ b/tools/run-parallel/main.go @@ -74,7 +74,11 @@ func run() error { } taskIndices := make(chan int, 64) - results := make([]string, len(perInstanceValues)) + type result struct { + msg string + success bool + } + results := make([]result, len(perInstanceValues)) numCPU := runtime.NumCPU() wg := sync.WaitGroup{} @@ -89,7 +93,7 @@ func run() error { } success, out := invoke(exe, taskArgs) if !success || !*onlyPrintFailures { - results[idx] = out + results[idx] = result{out, success} } } }() @@ -102,12 +106,16 @@ func run() error { wg.Wait() - for _, output := range results { - if output != "" { - fmt.Println(output) + success := true + for _, result := range results { + if result.msg != "" { + fmt.Println(result.msg) } + success = success && result.success + } + if !success { + os.Exit(1) } - return nil } @@ -116,7 +124,10 @@ func invoke(exe string, args []string) (ok bool, output string) { out, err := cmd.CombinedOutput() str := string(out) if err != nil { - return false, "\n" + err.Error() + if str != "" { + return false, str + } + return false, err.Error() } return true, str }