When merging tests, prefer non-blocklisted ones.
The test blocklist was failing when multiple tests were merged into
one. To fix this, when merging tests we prefer ones that are not
blocklisted.
Fixes: 193790055
Test: Run on the previously failing crate and another.
Change-Id: I53d1179bebef824ce80ac4f977015b04a26f8607
diff --git a/scripts/cargo2android.py b/scripts/cargo2android.py
index c6b5f04..99fe88e 100755
--- a/scripts/cargo2android.py
+++ b/scripts/cargo2android.py
@@ -303,6 +303,9 @@
# which can be changed if self is a merged test module.
self.decide_module_type()
if should_merge_test:
+ if (self.main_src in self.runner.args.test_blocklist and
+ not other.main_src in self.runner.args.test_blocklist):
+ self.main_src = other.main_src
self.srcs.append(other.main_src)
# use a short unique name as the merged module name.
prefix = self.root_pkg + '_tests'