runtests.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/env bash
  2. # Copyright (C) 2016 The Android Open Source Project
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. if [ -z $ANDROID_BUILD_TOP ]; then
  16. echo "You need to source and lunch before you can use this script"
  17. exit 1
  18. fi
  19. echo "Running tests"
  20. set -e # fail early
  21. # NOTE We can't actually run these commands, since they rely on functions added by
  22. # build/envsetup.sh to the bash shell environment.
  23. echo "+ mmma -j32 $ANDROID_BUILD_TOP/system/connectivity/wifilogd"
  24. make -j32 -C $ANDROID_BUILD_TOP -f build/core/main.mk \
  25. MODULES-IN-system-connectivity-wifilogd
  26. set -x # print commands
  27. adb wait-for-device
  28. adb root
  29. adb wait-for-device
  30. # 'disable-verity' will appear in 'adb remount' output if
  31. # dm-verity is enabled and needs to be disabled.
  32. if adb remount | grep 'disable-verity'; then
  33. adb disable-verity
  34. adb reboot
  35. adb wait-for-device
  36. adb root
  37. adb wait-for-device
  38. adb remount
  39. fi
  40. adb sync
  41. adb shell /data/nativetest/wifilogd_unit_test/wifilogd_unit_test
  42. adb shell /data/nativetest64/wifilogd_unit_test/wifilogd_unit_test