diff options
author | 2025-03-06 18:12:50 -0800 | |
---|---|---|
committer | 2025-03-06 18:12:50 -0800 | |
commit | df36bb4261b9db1f8ad1242a18c496d4d254cea0 (patch) | |
tree | 20bf4932e5e1aa421db106eb96ea63af0f0e28f0 /ci_tests | |
parent | 83659e4eced138ba75125db8ac123e9c5846ce7c (diff) | |
parent | 98a34c97540dd6e781e9adf391135b408ccb9d3d (diff) |
Merge "Fix path replacement logic for test_package" into main
Diffstat (limited to 'ci_tests')
-rw-r--r-- | ci_tests/ci_test_package_zip.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ci_tests/ci_test_package_zip.go b/ci_tests/ci_test_package_zip.go index f700a7061..451dac4cc 100644 --- a/ci_tests/ci_test_package_zip.go +++ b/ci_tests/ci_test_package_zip.go @@ -236,20 +236,21 @@ func extendBuilderCommand(ctx android.ModuleContext, m android.Module, builder * if strings.HasPrefix(f, "out") { continue } - f = strings.ReplaceAll(f, "system/", "DATA/") + if strings.HasPrefix(f, "system/") { + f = strings.Replace(f, "system/", "DATA/", 1) + } f = strings.ReplaceAll(f, filepath.Join("testcases", name, arch), filepath.Join("DATA", class, name)) f = strings.ReplaceAll(f, filepath.Join("testcases", name, secondArch), filepath.Join("DATA", class, name)) - f = strings.ReplaceAll(f, "testcases", filepath.Join("DATA", class)) - f = strings.ReplaceAll(f, "data/", "DATA/") + if strings.HasPrefix(f, "testcases") { + f = strings.Replace(f, "testcases", filepath.Join("DATA", class), 1) + } + if strings.HasPrefix(f, "data/") { + f = strings.Replace(f, "data/", "DATA/", 1) + } f = strings.ReplaceAll(f, "DATA_other", "system_other") f = strings.ReplaceAll(f, "system_other/DATA", "system_other/system") dir := filepath.Dir(f) - // ignore the additional installed files from test - if strings.Contains(dir, "DATA/native_tests") || strings.Count(dir, "DATA") > 1 { - continue - } - tempOut := android.PathForModuleOut(ctx, "STAGING", f) builder.Command().Text("mkdir").Flag("-p").Text(filepath.Join(stagingDir.String(), dir)) builder.Command().Text("cp").Flag("-Rf").Input(installedFile).Output(tempOut) |