Switch T+ sdk snapshots to use use_source_config_var property

Previously, T+ sdk snapshots used soong_config_module_type boilerplate
like for S. This change switches T+ sdk snapshots to use the
use_source_config_var property that was added in T.

Bug: 235455192
Test: atest --host mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      # Extract art sdk and module_exports snapshots into
      # prebuilts/module_sdk/art and then run "m nothing"
Change-Id: I65cd462358bceede493623e6a51ffdb36bfc1885
This commit is contained in:
Paul Duffin
2022-06-08 17:26:51 +00:00
parent 57c56034d6
commit db3a3c7df6
4 changed files with 341 additions and 45 deletions

View File

@@ -391,7 +391,7 @@ def read_test_data(relative_path):
return f.read()
class TestSoongConfigBoilerplateInserter(unittest.TestCase):
class TestAndroidBpTransformations(unittest.TestCase):
def apply_transformations(self, src, transformations, expected):
producer = mm.SdkDistProducer(
@@ -414,9 +414,9 @@ class TestSoongConfigBoilerplateInserter(unittest.TestCase):
self.assertEqual(expected, result)
def test_common_mainline_module(self):
"""Tests the transformations applied to a common mainline module.
"""Tests the transformations applied to a common mainline sdk on S.
This uses ipsec as an example of a common mainline module. This checks
This uses ipsec as an example of a common mainline sdk. This checks
that the correct Soong config module types and variables are used and
that it imports the definitions from the correct location.
"""
@@ -429,17 +429,25 @@ class TestSoongConfigBoilerplateInserter(unittest.TestCase):
self.apply_transformations(src, transformations, expected)
# Check that Tiramisu provides the same transformations as S.
tiramisu_transformations = module.transformations(mm.Tiramisu)
self.assertEqual(
transformations,
tiramisu_transformations,
msg="Tiramisu must use the same transformations as S")
def test_common_mainline_module_tiramisu(self):
"""Tests the transformations applied to a common mainline sdk on T.
This uses ipsec as an example of a common mainline sdk. This checks
that the use_source_config_var property is inserted.
"""
src = read_test_data("ipsec_Android.bp.input")
expected = read_test_data("ipsec_tiramisu_Android.bp.expected")
module = MAINLINE_MODULES_BY_APEX["com.android.ipsec"]
transformations = module.transformations(mm.Tiramisu)
self.apply_transformations(src, transformations, expected)
def test_optional_mainline_module(self):
"""Tests the transformations applied to an optional mainline module.
"""Tests the transformations applied to an optional mainline sdk on S.
This uses wifi as an example of a optional mainline module. This checks
This uses wifi as an example of a optional mainline sdk. This checks
that the module specific Soong config module types and variables are
used.
"""
@@ -452,12 +460,20 @@ class TestSoongConfigBoilerplateInserter(unittest.TestCase):
self.apply_transformations(src, transformations, expected)
# Check that Tiramisu provides the same transformations as S.
tiramisu_transformations = module.transformations(mm.Tiramisu)
self.assertEqual(
transformations,
tiramisu_transformations,
msg="Tiramisu must use the same transformations as S")
def test_optional_mainline_module_tiramisu(self):
"""Tests the transformations applied to an optional mainline sdk on T.
This uses wifi as an example of a optional mainline sdk. This checks
that the use_source_config_var property is inserted.
"""
src = read_test_data("wifi_Android.bp.input")
expected = read_test_data("wifi_tiramisu_Android.bp.expected")
module = MAINLINE_MODULES_BY_APEX["com.android.wifi"]
transformations = module.transformations(mm.Tiramisu)
self.apply_transformations(src, transformations, expected)
def test_art(self):
"""Tests the transformations applied to a the ART mainline module.