From d11be480f398985bdbbdc00b8442ff9b3d7fa85f Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Thu, 5 Nov 2020 16:13:36 +0100 Subject: [PATCH] cargo2android: reorder TEST_MAPPING statements "host: true" entry should go before "name:" to match the output of json writers which sort by alphabetical order. This will help and avoid unnecesary changes when adding new tests to TEST_MAPPING - e.g. aosp/1488728 Bug: 168167373 Test: cargo2android.py --run --tests verify output Change-Id: Id346a7f8a2cd910115e7fcc448c589363209bee9 --- scripts/cargo2android.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/cargo2android.py b/scripts/cargo2android.py index 1b6f74eaf..25e98800b 100755 --- a/scripts/cargo2android.py +++ b/scripts/cargo2android.py @@ -203,11 +203,10 @@ class TestMapping(object): if not is_first: # add comma and '\n' after the previous entry outf.write(',\n') is_first = False - outf.write(' {\n "name": "' + name + '"') + outf.write(' {\n') if host: - outf.write(',\n "host": true\n }') - else: - outf.write('\n }') + outf.write(' "host": true,\n') + outf.write(' "name": "' + name + '"' + '\n }') outf.write('\n ]\n}\n')