From 3b1c6847c4920392ca00fe32fe3acc17246eda91 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 26 Jul 2024 11:52:57 -0700 Subject: Make PathForArbitraryOutput return an OutputPath The only place basePath is used as a Path is when being returned from PathForArbitraryOutput. Using it as a Path requires implementing the RelativeToTop() method on it, which then allowed that method to be inherited by SourcePath, breaking the contract on RelativeToTop that specifies that the returned Path is of the same concrete type as the input Path. Make PathForArbitraryOutput return an OutputPath, and update OutputPath to support base paths that are not out/soong. This also fixes RelativeToTop, which was previously not working for PathForArbitraryOutput paths. Test: all soong tests pass Flag: EXEMPT refactor Change-Id: Ie8d8e2290961f35280e97137d2bd641c4d57ab87 --- filesystem/filesystem_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'filesystem/filesystem_test.go') diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 2dc8c21e0..8c0d11178 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -16,7 +16,6 @@ package filesystem import ( "os" - "path/filepath" "testing" "android/soong/android" @@ -147,8 +146,8 @@ func TestIncludeMakeBuiltFiles(t *testing.T) { output := result.ModuleForTests("myfilesystem", "android_common").Output("myfilesystem.img") - stampFile := filepath.Join(result.Config.OutDir(), "target/product/test_device/obj/PACKAGING/system_intermediates/staging_dir.stamp") - fileListFile := filepath.Join(result.Config.OutDir(), "target/product/test_device/obj/PACKAGING/system_intermediates/file_list.txt") + stampFile := "out/target/product/test_device/obj/PACKAGING/system_intermediates/staging_dir.stamp" + fileListFile := "out/target/product/test_device/obj/PACKAGING/system_intermediates/file_list.txt" android.AssertStringListContains(t, "deps of filesystem must include the staging dir stamp file", output.Implicits.Strings(), stampFile) android.AssertStringListContains(t, "deps of filesystem must include the staging dir file list", output.Implicits.Strings(), fileListFile) } -- cgit v1.2.3-59-g8ed1b