summaryrefslogtreecommitdiff
path: root/android/androidmk_test.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2025-02-25 14:45:43 -0800
committer Cole Faust <colefaust@google.com> 2025-02-25 15:13:33 -0800
commita8437c5643c798169cadafe2a0b68e6298fe0f34 (patch)
treea5132081ba913c19930b56052944b0d174ce0ef3 /android/androidmk_test.go
parent08d40a1b365ca91981ce72ed44b33297c94d0e4a (diff)
Divorce disting from androidmk
Change AndroidMkEntries.getDistContributions and AndroidMkInfo.getDistContributions into a freestanding getDistContributions. This enables us to not call the AndroidMk related functions in soong-only builds. Bug: 398938465 Test: Diff'd the ninja files from "m nothing dist" before/after this cl, no changes Change-Id: I2f9d537c0d66f0ae3715f083e2f55436e4c0a59f
Diffstat (limited to 'android/androidmk_test.go')
-rw-r--r--android/androidmk_test.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/android/androidmk_test.go b/android/androidmk_test.go
index 4cdd6a37b..cd61133ef 100644
--- a/android/androidmk_test.go
+++ b/android/androidmk_test.go
@@ -346,7 +346,7 @@ func TestGetDistContributions(t *testing.T) {
if len(entries) != 1 {
t.Errorf("Expected a single AndroidMk entry, got %d", len(entries))
}
- distContributions := entries[0].getDistContributions(module)
+ distContributions := getDistContributions(ctx, module)
if err := compareContributions(expectedContributions, distContributions); err != nil {
t.Errorf("%s\nExpected Contributions\n%sActualContributions\n%s",
@@ -648,8 +648,8 @@ func TestGetDistContributions(t *testing.T) {
default_dist_files: "none",
dist_output_file: false,
dists: [
- // The following is silently ignored because there is not default file
- // in either the dist files or the output file.
+ // The following will dist one.out because there's no default dist file provided
+ // (default_dist_files: "none") and one.out is the outputfile for the "" tag.
{
targets: ["my_goal"],
},
@@ -664,6 +664,12 @@ func TestGetDistContributions(t *testing.T) {
{
goals: "my_goal",
copies: []distCopy{
+ distCopyForTest("one.out", "one.out"),
+ },
+ },
+ {
+ goals: "my_goal",
+ copies: []distCopy{
distCopyForTest("two.out", "two.out"),
distCopyForTest("three/four.out", "four.out"),
},