Convert `test/utils/regen-test-files` from Bash to Python.

This conversion is pretty much a literal one on purpose, to help spot
differences between the old and the new implementations. Improvements
(especially better use of Python idioms) will be made in subsequent
commits.

The new Python implementation is 25 times faster than the old Bash
implementation (execution time went down from 5 seconds to 0.2
seconds).

Test: Run `test/utils/regen-test-files` and check the resulting
      `TEST_MAPPING` and `Android.bp` files are unchanged.
Bug: 147814778

Change-Id: Ic3e8138e83b281f2cc4c688a2c8a237d1a155a08
1 file changed