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

Commit 6fe7fff8 authored by Jack He's avatar Jack He
Browse files

Cert: Add --repeat option to gd/cert/run

* This option allows a test to run multiple times within one setup
  so that test owners can test the robustness of their tests

Test: source gd/cert/run --host --test_filter=CertSelfTest --repeat=5
Bug: 151989046
Change-Id: I8e057772d6a296d3c20ced0d68e3afcf0052a682
parent bd5c4668
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ $ANDROID_BUILD_TOP/build/soong/soong_ui.bash --build-mode --"all-modules" --dir=
TEST_CONFIG="$ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/cert/android_devices_config.json"
TEST_FILTER="-tf $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/cert/all_cert_testcases"
REUSE_VENV=false
NUM_REPETITIONS="1"

POSITIONAL=()
while [[ $# -gt 0 ]]
@@ -45,6 +46,11 @@ case $key in
    REUSE_VENV=true
    shift # past argument
    ;;
    # Repeat running the specified test cases by N times in one single setup
    --repeat=*)
    NUM_REPETITIONS="${key#*=}"
    shift # past argument
    ;;
    *)    # unknown option
    POSITIONAL+=("$1") # save it in an array for later
    shift # past argument
@@ -86,7 +92,9 @@ if [[ $? -ne 0 ]] ; then
  exit 1
fi

for n in $(seq $NUM_REPETITIONS); do
  $CERT_TEST_VENV/bin/python $CERT_TEST_VENV/bin/act.py \
      -c $TEST_CONFIG \
      $TEST_FILTER \
      -tp $CERT_TEST_VENV/acts
done