update_crate_tests: fail gracefully

Allow this script to accept a path to the crate being updated.
This allows it to be run separately from cargo2android.

Also, fail gracefully on error. TEST_MAPPING update failures should
not block crate updates.

Test: tools/external_updater/updater.sh update rust/crates/libc
Bug: 179132533
Change-Id: I3a4229f479ab3d2793df16b470f0a0632b9ee495
This commit is contained in:
Jeff Vander Stoep
2021-02-03 18:52:42 +01:00
parent 8aedba5144
commit 1b24dc3f71
2 changed files with 26 additions and 13 deletions

View File

@@ -1152,7 +1152,7 @@ class Runner(object):
if self.dry_run:
print('Dry-run skip dump of TEST_MAPPING')
else:
test_mapping = TestMapping()
test_mapping = TestMapping(None)
for bp_file_name in self.bp_files:
test_mapping.create_test_mapping(os.path.dirname(bp_file_name))
return self