diff options
author | 2019-11-22 14:34:55 -0800 | |
---|---|---|
committer | 2019-12-05 11:17:09 -0800 | |
commit | e5cd4e10a070b75d4dd04b4c21e12c3f6943a424 (patch) | |
tree | febe9f2466275447bb91c4e3ca7202bd709de75b /scripts/manifest.py | |
parent | 126c57b52d93fc8c86ae438a9fb39ad704b38479 (diff) |
Optionally overwrite package value in test config.
If package_name is set for an android_test module, package names in its
AndroidTest.xml config need to be updated too.
Test: test_config_fixer_test.py
Fixes: 145011263
Change-Id: I52f17ef1d1902364b9bcfec4f6e246bd655dbf09
Diffstat (limited to 'scripts/manifest.py')
-rwxr-xr-x | scripts/manifest.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/manifest.py b/scripts/manifest.py index 4c75f8bf2..04f7405df 100755 --- a/scripts/manifest.py +++ b/scripts/manifest.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -"""A tool for inserting values from the build system into a manifest.""" +"""A tool for inserting values from the build system into a manifest or a test config.""" from __future__ import print_function from xml.dom import minidom @@ -65,6 +65,15 @@ def ensure_manifest_android_ns(doc): ns.value) +def parse_test_config(doc): + """ Get the configuration element. """ + + test_config = doc.documentElement + if test_config.tagName != 'configuration': + raise RuntimeError('expected configuration tag at root') + return test_config + + def as_int(s): try: i = int(s) |