Merge "Export provenance metadata for prebuilt APKs and APEXes." am: c055d88c16
am: c41308e05e
am: d58ecd96a8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2045371 Change-Id: Idd4f83b79dd05e7f299cd26110bdc1f22d7b2e49 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -3890,7 +3890,7 @@ func TestVndkApexWithBinder32(t *testing.T) {
|
||||
}),
|
||||
withBinder32bit,
|
||||
withTargets(map[android.OsType][]android.Target{
|
||||
android.Android: []android.Target{
|
||||
android.Android: {
|
||||
{Os: android.Android, Arch: android.Arch{ArchType: android.Arm, ArchVariant: "armv7-a-neon", Abi: []string{"armeabi-v7a"}},
|
||||
NativeBridge: android.NativeBridgeDisabled, NativeBridgeHostArchName: "", NativeBridgeRelativePath: ""},
|
||||
},
|
||||
@@ -4571,12 +4571,20 @@ func TestPrebuilt(t *testing.T) {
|
||||
}
|
||||
`)
|
||||
|
||||
prebuilt := ctx.ModuleForTests("myapex", "android_common_myapex").Module().(*Prebuilt)
|
||||
testingModule := ctx.ModuleForTests("myapex", "android_common_myapex")
|
||||
prebuilt := testingModule.Module().(*Prebuilt)
|
||||
|
||||
expectedInput := "myapex-arm64.apex"
|
||||
if prebuilt.inputApex.String() != expectedInput {
|
||||
t.Errorf("inputApex invalid. expected: %q, actual: %q", expectedInput, prebuilt.inputApex.String())
|
||||
}
|
||||
android.AssertStringDoesContain(t, "Invalid provenance metadata file",
|
||||
prebuilt.ProvenanceMetaDataFile().String(), "soong/.intermediates/provenance_metadata/myapex/provenance_metadata.textproto")
|
||||
rule := testingModule.Rule("genProvenanceMetaData")
|
||||
android.AssertStringEquals(t, "Invalid input", "myapex-arm64.apex", rule.Inputs[0].String())
|
||||
android.AssertStringEquals(t, "Invalid output", "out/soong/.intermediates/provenance_metadata/myapex/provenance_metadata.textproto", rule.Output.String())
|
||||
android.AssertStringEquals(t, "Invalid args", "myapex", rule.Args["module_name"])
|
||||
android.AssertStringEquals(t, "Invalid args", "/system/apex/myapex.apex", rule.Args["install_path"])
|
||||
}
|
||||
|
||||
func TestPrebuiltMissingSrc(t *testing.T) {
|
||||
@@ -4596,12 +4604,18 @@ func TestPrebuiltFilenameOverride(t *testing.T) {
|
||||
}
|
||||
`)
|
||||
|
||||
p := ctx.ModuleForTests("myapex", "android_common_myapex").Module().(*Prebuilt)
|
||||
testingModule := ctx.ModuleForTests("myapex", "android_common_myapex")
|
||||
p := testingModule.Module().(*Prebuilt)
|
||||
|
||||
expected := "notmyapex.apex"
|
||||
if p.installFilename != expected {
|
||||
t.Errorf("installFilename invalid. expected: %q, actual: %q", expected, p.installFilename)
|
||||
}
|
||||
rule := testingModule.Rule("genProvenanceMetaData")
|
||||
android.AssertStringEquals(t, "Invalid input", "myapex-arm.apex", rule.Inputs[0].String())
|
||||
android.AssertStringEquals(t, "Invalid output", "out/soong/.intermediates/provenance_metadata/myapex/provenance_metadata.textproto", rule.Output.String())
|
||||
android.AssertStringEquals(t, "Invalid args", "myapex", rule.Args["module_name"])
|
||||
android.AssertStringEquals(t, "Invalid args", "/system/apex/notmyapex.apex", rule.Args["install_path"])
|
||||
}
|
||||
|
||||
func TestApexSetFilenameOverride(t *testing.T) {
|
||||
@@ -4644,13 +4658,19 @@ func TestPrebuiltOverrides(t *testing.T) {
|
||||
}
|
||||
`)
|
||||
|
||||
p := ctx.ModuleForTests("myapex.prebuilt", "android_common_myapex.prebuilt").Module().(*Prebuilt)
|
||||
testingModule := ctx.ModuleForTests("myapex.prebuilt", "android_common_myapex.prebuilt")
|
||||
p := testingModule.Module().(*Prebuilt)
|
||||
|
||||
expected := []string{"myapex"}
|
||||
actual := android.AndroidMkEntriesForTest(t, ctx, p)[0].EntryMap["LOCAL_OVERRIDES_MODULES"]
|
||||
if !reflect.DeepEqual(actual, expected) {
|
||||
t.Errorf("Incorrect LOCAL_OVERRIDES_MODULES value '%s', expected '%s'", actual, expected)
|
||||
}
|
||||
rule := testingModule.Rule("genProvenanceMetaData")
|
||||
android.AssertStringEquals(t, "Invalid input", "myapex-arm.apex", rule.Inputs[0].String())
|
||||
android.AssertStringEquals(t, "Invalid output", "out/soong/.intermediates/provenance_metadata/myapex.prebuilt/provenance_metadata.textproto", rule.Output.String())
|
||||
android.AssertStringEquals(t, "Invalid args", "myapex.prebuilt", rule.Args["module_name"])
|
||||
android.AssertStringEquals(t, "Invalid args", "/system/apex/myapex.prebuilt.apex", rule.Args["install_path"])
|
||||
}
|
||||
|
||||
func TestPrebuiltApexName(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user