simpleperf: improve test.py.

1. Replace unittest progress output with a custom output:
  a. Write test begin/end messages in both stderr and log file, also
     output test time. This avoids stdout caching. So we know which
     test is running.
  b. Output failure messages for a test immediately after it finishes.
     So we don't lose them if stopping test.py in the middle.

2. Avoid overwhelming output in the screen.
  a. Drop output of sub processes in run_cmd() by default.
  b. Don't output long string when check fails in
  check_strings_in_content().

3. On windows, it's an error trying to delete files used by another
  process. So some tests fail when they delete the current dir.
  Fix them by avoiding this situation.

4. Update location to find ndk installed by Android Studio.

Bug: 159823110
Test: run test.py.
Change-Id: I1f6bed1a439afea4054e63feeeb679a451689935
2 files changed