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

Commit fa64ac9f authored by Zach Johnson's avatar Zach Johnson Committed by Andre Eisenbach
Browse files

Add bash script for running unit tests

This script helps simplify pushing and running bluedroid unit tests.
You can run all of the known ones, or provide names of selected unit
test executables you wish to run.
parent 8643dc94
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash

known_tests=(
  net_test_btcore
  net_test_hci
  net_test_osi
)

usage() {
  echo "Usage: $0 [--all|--help|<test names>]"
  echo ""
  echo "Known test names:"

  for name in ${known_tests[*]}
  do
    echo "    $name"
  done
}

run_tests() {
  for name in $*
  do
    echo "--- $name ---"
    echo "pushing..."
    adb push {$ANDROID_PRODUCT_OUT,}/data/nativetest/$name/$name
    echo "running..."
    adb shell data/nativetest/$name/$name
  done
}

if [ $# -eq 0 ] || [ $1 == "--help" ]; then
  usage
elif [ $1 == "--all" ]; then
  run_tests ${known_tests[*]}
else
  run_tests $*
fi