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
diff --git a/scripts/cargo2android.py b/scripts/cargo2android.py
index f32061e..7d3b66a 100755
--- a/scripts/cargo2android.py
+++ b/scripts/cargo2android.py
@@ -1152,7 +1152,7 @@
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