summaryrefslogtreecommitdiff
path: root/scripts/manifest_check_test.py
diff options
context:
space:
mode:
author Ulya Trafimovich <skvadrik@google.com> 2021-07-20 14:27:32 +0100
committer Ulya Trafimovich <skvadrik@google.com> 2021-07-20 14:30:40 +0100
commit1b513458b163c393e2d7fe14966d9b4432852675 (patch)
tree6c35ac965e1a679e4bc2d87acbe847b3d3743aaa /scripts/manifest_check_test.py
parentae86338676084cf5966adf99f34e7086f9687edc (diff)
manifest_check.py: trim namespace part of the module, if needed.
Normally Soong does that automatically when it handles module names specified in Android.bp properties. However not all <uses-library> entries in the manifest correspond to real modules: some of the optional libraries may be missing at build time. Therefor this script accepts raw module names as spelled in Android.bp/Amdroid.mk and trims the optional namespace part manually. Bug: 193891722 Test: manifest_check_test.py Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd $ adb wait-for-device && \ adb root && \ adb logcat | \ grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C1 # empty output, no errors Change-Id: I184fb8a2dc26f49e90fb597ebcd6a58c00705206
Diffstat (limited to 'scripts/manifest_check_test.py')
-rwxr-xr-xscripts/manifest_check_test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/manifest_check_test.py b/scripts/manifest_check_test.py
index 7159bdd74..e3e8ac468 100755
--- a/scripts/manifest_check_test.py
+++ b/scripts/manifest_check_test.py
@@ -183,6 +183,15 @@ class EnforceUsesLibrariesTest(unittest.TestCase):
optional_uses_libraries=['bar'])
self.assertTrue(matches)
+ def test_mixed_with_namespace(self):
+ xml = self.xml_tmpl % ('\n'.join([uses_library_xml('foo'),
+ uses_library_xml('bar', required_xml(False))]))
+ apk = self.apk_tmpl % ('\n'.join([uses_library_apk('foo'),
+ uses_library_apk('bar', required_apk(False))]))
+ matches = self.run_test(xml, apk, uses_libraries=['//x/y/z:foo'],
+ optional_uses_libraries=['//x/y/z:bar'])
+ self.assertTrue(matches)
+
class ExtractTargetSdkVersionTest(unittest.TestCase):
def run_test(self, xml, apk, version):