diff options
author | Logan Chien <loganchien@google.com> | 2018-03-12 16:29:17 +0800 |
---|---|---|
committer | Logan Chien <loganchien@google.com> | 2018-03-16 17:45:42 +0800 |
commit | d44aa3b5c8afbfeb66e39668bab3ec0fac63f1e6 (patch) | |
tree | f9bd69ac0212653911565c8491d42616b1467bcd /cc/cc_test.go | |
parent | 3985402d74c7743724daecfc68dc10388cb870d9 (diff) | |
download | build_soong-d44aa3b5c8afbfeb66e39668bab3ec0fac63f1e6.tar.gz build_soong-d44aa3b5c8afbfeb66e39668bab3ec0fac63f1e6.tar.bz2 build_soong-d44aa3b5c8afbfeb66e39668bab3ec0fac63f1e6.zip |
Extract failIfErrored() to android/testing.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make # runs unit tests
Merged-In: I1c09412d5988dca2cc1c5f041893b313ab1c163a
Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
Diffstat (limited to 'cc/cc_test.go')
-rw-r--r-- | cc/cc_test.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/cc/cc_test.go b/cc/cc_test.go index 19e4703b..63296056 100644 --- a/cc/cc_test.go +++ b/cc/cc_test.go @@ -147,9 +147,9 @@ func testCcWithConfig(t *testing.T, bp string, config android.Config) *android.T ctx := createTestContext(t, config, bp) _, errs := ctx.ParseFileList(".", []string{"Android.bp"}) - failIfErrored(t, errs) + android.FailIfErrored(t, errs) _, errs = ctx.PrepareBuildActions(config) - failIfErrored(t, errs) + android.FailIfErrored(t, errs) return ctx } @@ -1064,15 +1064,6 @@ func TestLinkReordering(t *testing.T) { } } -func failIfErrored(t *testing.T, errs []error) { - if len(errs) > 0 { - for _, err := range errs { - t.Error(err) - } - t.FailNow() - } -} - func failIfNoMatchingErrors(t *testing.T, pattern string, errs []error) { matcher, err := regexp.Compile(pattern) if err != nil { |