diff options
Diffstat (limited to 'android/paths_test.go')
-rw-r--r-- | android/paths_test.go | 216 |
1 files changed, 144 insertions, 72 deletions
diff --git a/android/paths_test.go b/android/paths_test.go index bf46c34f3..93b9b9a16 100644 --- a/android/paths_test.go +++ b/android/paths_test.go @@ -268,8 +268,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "host binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: hostTarget.Os, - target: hostTarget, + archModuleContext: archModuleContext{ + os: hostTarget.Os, + target: hostTarget, + }, }, }, in: []string{"bin", "my_test"}, @@ -281,8 +283,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "system binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, }, in: []string{"bin", "my_test"}, @@ -293,8 +297,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "vendor binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: socSpecificModule, }, @@ -308,8 +314,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "odm binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: deviceSpecificModule, }, @@ -323,8 +331,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "product binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: productSpecificModule, }, @@ -338,8 +348,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "system_ext binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: systemExtSpecificModule, }, @@ -353,8 +365,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "root binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inRoot: true, }, @@ -366,8 +380,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "recovery binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inRecovery: true, }, @@ -379,8 +395,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "recovery root binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inRecovery: true, inRoot: true, @@ -394,8 +412,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "ramdisk binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inRamdisk: true, }, @@ -407,8 +427,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "ramdisk root binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inRamdisk: true, inRoot: true, @@ -421,8 +443,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "vendor_ramdisk binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inVendorRamdisk: true, }, @@ -434,8 +458,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "vendor_ramdisk root binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inVendorRamdisk: true, inRoot: true, @@ -448,8 +474,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "debug_ramdisk binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inDebugRamdisk: true, }, @@ -461,8 +489,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "system native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inData: true, }, @@ -474,8 +504,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "vendor native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: socSpecificModule, }, @@ -490,8 +522,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "odm native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: deviceSpecificModule, }, @@ -506,8 +540,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "product native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: productSpecificModule, }, @@ -523,8 +559,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "system_ext native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: systemExtSpecificModule, }, @@ -540,8 +578,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized system binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inSanitizerDir: true, }, @@ -553,8 +593,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized vendor binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: socSpecificModule, }, @@ -569,8 +611,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized odm binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: deviceSpecificModule, }, @@ -585,8 +629,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized product binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: productSpecificModule, }, @@ -602,8 +648,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized system_ext binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: systemExtSpecificModule, }, @@ -619,8 +667,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized system native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inData: true, inSanitizerDir: true, @@ -633,8 +683,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized vendor native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: socSpecificModule, }, @@ -650,8 +702,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized odm native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: deviceSpecificModule, }, @@ -667,8 +721,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized product native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: productSpecificModule, }, @@ -684,8 +740,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "sanitized system_ext native test binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, earlyModuleContext: earlyModuleContext{ kind: systemExtSpecificModule, }, @@ -700,8 +758,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "device testcases", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inTestcases: true, }, @@ -712,8 +772,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "host testcases", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: hostTarget.Os, - target: hostTarget, + archModuleContext: archModuleContext{ + os: hostTarget.Os, + target: hostTarget, + }, }, inTestcases: true, }, @@ -724,8 +786,10 @@ func TestPathForModuleInstall(t *testing.T) { name: "forced host testcases", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inTestcases: true, forceOS: &Linux, @@ -771,8 +835,10 @@ func TestPathForModuleInstallRecoveryAsBoot(t *testing.T) { name: "ramdisk binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inRamdisk: true, inRoot: true, @@ -786,8 +852,10 @@ func TestPathForModuleInstallRecoveryAsBoot(t *testing.T) { name: "vendor_ramdisk binary", ctx: &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, inVendorRamdisk: true, inRoot: true, @@ -821,8 +889,10 @@ func TestBaseDirForInstallPath(t *testing.T) { ctx := &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, } ctx.baseModuleContext.config = testConfig @@ -1491,8 +1561,10 @@ func TestPathRelativeToTop(t *testing.T) { ctx := &testModuleInstallPathContext{ baseModuleContext: baseModuleContext{ - os: deviceTarget.Os, - target: deviceTarget, + archModuleContext: archModuleContext{ + os: deviceTarget.Os, + target: deviceTarget, + }, }, } ctx.baseModuleContext.config = testConfig |