Runtime support for dist-for-goals.
Convert dist-for-goals.
Bug: 198496782
Test: rbcrun build/make/tests/run.rbc
Change-Id: I46ef9e897143aecf8bd28ad8569d48e74530b0e5
diff --git a/tests/device.rbc b/tests/device.rbc
index 37c5d0c..9ae6393 100644
--- a/tests/device.rbc
+++ b/tests/device.rbc
@@ -55,6 +55,9 @@
rblf.soong_config_set(g, "NS2", "v3", "abc")
rblf.soong_config_set(g, "NS2", "v3", "xyz")
+ rblf.mkdist_for_goals(g, "goal", "dir1/file1:out1 dir1/file2:out2")
+ rblf.mkdist_for_goals(g, "goal", "dir2/file2:")
+
if rblf.board_platform_in(g, "board1 board2"):
cfg["PRODUCT_PACKAGES"] += ["bad_package"]
g["TARGET_BOARD_PLATFORM"] = "board1"
diff --git a/tests/run.rbc b/tests/run.rbc
index d222341..31436c5 100644
--- a/tests/run.rbc
+++ b/tests/run.rbc
@@ -102,3 +102,11 @@
assert_eq("xyz", rblf.soong_config_get(globals, "NS2", "v3"))
assert_eq(None, rblf.soong_config_get(globals, "NS2", "nonexistant_var"))
+
+goals = globals["$dist_for_goals"]
+assert_eq(
+ {
+ "goal": [("dir1/file1", "out1"), ("dir1/file2", "out2"), ("dir2/file2", "file2")]
+ },
+ { k:v for k,v in sorted(goals.items()) }
+)