OSDN Git Service

TEST: Fix host native test script
authorJack He <siyuanh@google.com>
Mon, 23 Oct 2017 20:28:59 +0000 (13:28 -0700)
committerJack He <siyuanh@google.com>
Tue, 24 Oct 2017 01:52:27 +0000 (18:52 -0700)
commit39555a3f0afaebc6a79fc8545ecd7284dd874f68
tree0d8a05f4ca6b62284248c6f73df9747088502e14
parent5b790feeeb211c42bf78ca3ae9c26aa30e516765
TEST: Fix host native test script

* Use build/soong/soong_ui.bash to get needed environment variables
  instead of getting them directly from the parent shell
* Simplify the build command use to 'soong_ui.bash' directly so that
  we can remove the call to envsetup
* When ANDROID_BUILD_TOP is not set, try finding it by looking for
  build/soong/soong_ui.bash in all parent directories until found,
  and get TOP variable from it
* Similarly, for ANDROID_HOST_OUT, use the same soong_ui.bash script to
  get it, instead of relying on the environment variable
* Also fixed a bug in test log output by prepending DIST_DIR to the
  output file path so that it can be grabbed by the server

Bug: 64687730
Test: run run_host_unit_tests script in both
        1) vanilla environment without envsetup and lunch
        2) fulled setup and lunched environemt
      to verify
        1) If nothing is setup, the script picks a default environment
2) If envirnoment is already setup, use existing environment
   instead of creating new one

Change-Id: Ife28db509fe9af55cef26c7b480196efae39d3aa
test/run_host_unit_tests.py