Stop sdk package depending on testing.T being embedded in TestResult

This change is in preparation for removing testing.T from TestResult.

Bug: 181070625
Test: m nothing
Change-Id: I67535aff0d894e6e3d8456b75540f340af853355
This commit is contained in:
Paul Duffin
2021-03-12 12:19:43 +00:00
parent e84b1338c5
commit 36474d322b
7 changed files with 103 additions and 116 deletions

View File

@@ -169,7 +169,7 @@ func TestSnapshotVisibility(t *testing.T) {
"package/Android.bp": []byte(packageBp),
})
CheckSnapshot(result, "mysdk", "package",
CheckSnapshot(t, result, "mysdk", "package",
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
@@ -317,9 +317,8 @@ func TestSdkInstall(t *testing.T) {
`
result := testSdkWithFs(t, sdk, nil)
CheckSnapshot(result, "mysdk", "",
checkAllOtherCopyRules(`.intermediates/mysdk/common_os/mysdk-current.zip -> mysdk-current.zip`),
)
CheckSnapshot(t, result, "mysdk", "",
checkAllOtherCopyRules(`.intermediates/mysdk/common_os/mysdk-current.zip -> mysdk-current.zip`))
}
type EmbeddedPropertiesStruct struct {
@@ -387,12 +386,10 @@ func TestCommonValueOptimization(t *testing.T) {
extractor := newCommonValueExtractor(common)
h := android.TestHelper{t}
err := extractor.extractCommonProperties(common, structs)
h.AssertDeepEquals("unexpected error", nil, err)
android.AssertDeepEquals(t, "unexpected error", nil, err)
h.AssertDeepEquals("common properties not correct",
android.AssertDeepEquals(t, "common properties not correct",
&testPropertiesStruct{
name: "common",
private: "",
@@ -410,7 +407,7 @@ func TestCommonValueOptimization(t *testing.T) {
},
common)
h.AssertDeepEquals("updated properties[0] not correct",
android.AssertDeepEquals(t, "updated properties[0] not correct",
&testPropertiesStruct{
name: "struct-0",
private: "common",
@@ -428,7 +425,7 @@ func TestCommonValueOptimization(t *testing.T) {
},
structs[0])
h.AssertDeepEquals("updated properties[1] not correct",
android.AssertDeepEquals(t, "updated properties[1] not correct",
&testPropertiesStruct{
name: "struct-1",
private: "common",
@@ -462,10 +459,8 @@ func TestCommonValueOptimization_InvalidArchSpecificVariants(t *testing.T) {
extractor := newCommonValueExtractor(common)
h := android.TestHelper{t}
err := extractor.extractCommonProperties(common, structs)
h.AssertErrorMessageEquals("unexpected error", `field "S_Common" is not tagged as "arch_variant" but has arch specific properties:
android.AssertErrorMessageEquals(t, "unexpected error", `field "S_Common" is not tagged as "arch_variant" but has arch specific properties:
"struct-0" has value "should-be-but-is-not-common0"
"struct-1" has value "should-be-but-is-not-common1"`, err)
}