Fix missing printed errors from run-parallel

These errors were captured, but not printed.

Fix the lint error that was not being displayed.

Change-Id: I56da5c3a044b8a8e41695883ce780aca6245ad04
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44780
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2021-03-15 20:18:32 +00:00 committed by Commit Bot service account
parent c7e4032009
commit fd3cf82056
2 changed files with 19 additions and 8 deletions

View File

@ -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<type::F32>());
ASSERT_TRUE(f->return_type_decorations.size() == 1u);
ASSERT_EQ(f->return_type_decorations.size(), 1u);
auto* loc = f->return_type_decorations[0]->As<ast::LocationDecoration>();
ASSERT_TRUE(loc != nullptr);
EXPECT_EQ(loc->value(), 1u);

View File

@ -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
}