Move MAINLINE_MODULE_BY_APEX into the test file am: 300ec921e5 am: 19e34a43a1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/1957400 Change-Id: Ic47bc18230ee4002d288cbe8d67417e1e7d071b4
This commit is contained in:
@@ -356,9 +356,6 @@ MAINLINE_MODULES = [
|
|||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Only used by the test.
|
|
||||||
MAINLINE_MODULES_BY_APEX = dict((m.apex, m) for m in MAINLINE_MODULES)
|
|
||||||
|
|
||||||
# A list of the sdk versions to build. Usually just current but can include a
|
# A list of the sdk versions to build. Usually just current but can include a
|
||||||
# numeric version too.
|
# numeric version too.
|
||||||
SDK_VERSIONS = [
|
SDK_VERSIONS = [
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import zipfile
|
|||||||
|
|
||||||
import mainline_modules_sdks as mm
|
import mainline_modules_sdks as mm
|
||||||
|
|
||||||
|
MAINLINE_MODULES_BY_APEX = dict((m.apex, m) for m in mm.MAINLINE_MODULES)
|
||||||
|
|
||||||
|
|
||||||
class FakeSnapshotBuilder(mm.SnapshotBuilder):
|
class FakeSnapshotBuilder(mm.SnapshotBuilder):
|
||||||
"""A fake snapshot builder that does not run the build.
|
"""A fake snapshot builder that does not run the build.
|
||||||
@@ -62,8 +64,8 @@ class TestProduceDist(unittest.TestCase):
|
|||||||
os.mkdir(tmp_dist_dir)
|
os.mkdir(tmp_dist_dir)
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
mm.MAINLINE_MODULES_BY_APEX["com.android.art"],
|
MAINLINE_MODULES_BY_APEX["com.android.art"],
|
||||||
mm.MAINLINE_MODULES_BY_APEX["com.android.ipsec"],
|
MAINLINE_MODULES_BY_APEX["com.android.ipsec"],
|
||||||
]
|
]
|
||||||
|
|
||||||
subprocess_runner = mm.SubprocessRunner()
|
subprocess_runner = mm.SubprocessRunner()
|
||||||
@@ -161,7 +163,7 @@ class TestSoongConfigBoilerplateInserter(unittest.TestCase):
|
|||||||
|
|
||||||
expected = readTestData("ipsec_Android.bp.expected")
|
expected = readTestData("ipsec_Android.bp.expected")
|
||||||
|
|
||||||
module = mm.MAINLINE_MODULES_BY_APEX["com.android.ipsec"]
|
module = MAINLINE_MODULES_BY_APEX["com.android.ipsec"]
|
||||||
transformations = module.transformations()
|
transformations = module.transformations()
|
||||||
|
|
||||||
self.apply_transformations(src, transformations, expected)
|
self.apply_transformations(src, transformations, expected)
|
||||||
@@ -177,7 +179,7 @@ class TestSoongConfigBoilerplateInserter(unittest.TestCase):
|
|||||||
|
|
||||||
expected = readTestData("art_Android.bp.expected")
|
expected = readTestData("art_Android.bp.expected")
|
||||||
|
|
||||||
module = mm.MAINLINE_MODULES_BY_APEX["com.android.art"]
|
module = MAINLINE_MODULES_BY_APEX["com.android.art"]
|
||||||
transformations = module.transformations()
|
transformations = module.transformations()
|
||||||
|
|
||||||
self.apply_transformations(src, transformations, expected)
|
self.apply_transformations(src, transformations, expected)
|
||||||
@@ -192,7 +194,7 @@ class TestFilterModules(unittest.TestCase):
|
|||||||
def test_with_filter(self):
|
def test_with_filter(self):
|
||||||
os.environ["TARGET_BUILD_APPS"] = "com.android.art"
|
os.environ["TARGET_BUILD_APPS"] = "com.android.art"
|
||||||
modules = mm.filter_modules(mm.MAINLINE_MODULES)
|
modules = mm.filter_modules(mm.MAINLINE_MODULES)
|
||||||
expected = mm.MAINLINE_MODULES_BY_APEX["com.android.art"]
|
expected = MAINLINE_MODULES_BY_APEX["com.android.art"]
|
||||||
self.assertEqual(modules, [expected])
|
self.assertEqual(modules, [expected])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user