From 9f0dd71b8a565183a1137431d947d389e601fb62 Mon Sep 17 00:00:00 2001 From: Frederick Mayle Date: Wed, 17 Aug 2022 20:34:26 +0000 Subject: [PATCH] cargo2android: fix test detection when there is exactly 1 test Example where it failed: tests::sock_send_recv_event: test 1 test, 0 benchmarks Doc-tests vm_control 0 tests, 0 benchmarks the "1 test, 0 benchmarks" line wouldn't match the test regex, so it would mistakenly parse the doc tests line instead and then fail to generate a rust_test module. Test: ran on crosvm repo Change-Id: Id0286165405b58bf84b7261db842e272442c91e8 --- scripts/cargo2android.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cargo2android.py b/scripts/cargo2android.py index fdd7bb60d..77ddee4ad 100755 --- a/scripts/cargo2android.py +++ b/scripts/cargo2android.py @@ -129,7 +129,7 @@ WARNING_FILE_PAT = re.compile('^ *--> ([^:]*):[0-9]+') CARGO_TEST_LIST_START_PAT = re.compile('^\s*Running (.*) \(.*\)$') # cargo test --list output of the end of running a binary. -CARGO_TEST_LIST_END_PAT = re.compile('^(\d+) tests, (\d+) benchmarks$') +CARGO_TEST_LIST_END_PAT = re.compile('^(\d+) tests?, (\d+) benchmarks$') CARGO2ANDROID_RUNNING_PAT = re.compile('^### Running: .*$')