From 57fa23a5db2a15f6573b90534c44c39426cf0ad6 Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Thu, 15 Jul 2021 10:47:35 -0700 Subject: [PATCH] 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 --- scripts/cargo2android.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/cargo2android.py b/scripts/cargo2android.py index c6b5f0426..99fe88e56 100755 --- a/scripts/cargo2android.py +++ b/scripts/cargo2android.py @@ -303,6 +303,9 @@ class Crate(object): # 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'