Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff63fb90 authored by Scott James Remnant's avatar Scott James Remnant Committed by android-build-merger
Browse files

Add test filter option to run_unit_tests

am: a44a5648

* commit 'a44a5648':
  Add test filter option to run_unit_tests
parents d55f1e99 a44a5648
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ known_tests=(
)

usage() {
  echo "Usage: $0 [-s <specific device> ][--all|--help|<test names>]"
  echo "Usage: $0 [-s <specific device> ][--all|--help|<test name>[.<filter>] ...]"
  echo ""
  echo "Known test names:"

@@ -25,13 +25,17 @@ run_tests() {
  shift

  failed_tests=''
  for name in $*
  for spec in $*
  do
    name="${spec%%.*}"
    if [ "${name}" != "${spec}" ]; then
      filter="${spec#*.}"
    fi
    echo "--- $name ---"
    echo "pushing..."
    $adb push {$ANDROID_PRODUCT_OUT,}/data/nativetest/$name/$name
    echo "running..."
    $adb shell data/nativetest/$name/$name
    $adb shell data/nativetest/$name/$name${filter:+ "--gtest_filter=${filter}"}
    if [ $? != 0 ]; then
      failed_tests="$failed_tests$CR!!! FAILED TEST: $name !!!";
    fi