Extract failIfErrored() to android/testing.go
Bug: 74506774 Test: lunch aosp_walleye-userdebug && make # runs unit tests Merged-In: I1c09412d5988dca2cc1c5f041893b313ab1c163a Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
)
|
||||
@@ -152,3 +153,13 @@ func (m TestingModule) Output(file string) BuildParams {
|
||||
panic(fmt.Errorf("couldn't find output %q.\nall outputs: %v",
|
||||
file, searchedOutputs))
|
||||
}
|
||||
|
||||
func FailIfErrored(t *testing.T, errs []error) {
|
||||
t.Helper()
|
||||
if len(errs) > 0 {
|
||||
for _, err := range errs {
|
||||
t.Error(err)
|
||||
}
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user