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

Commit b4868646 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Simplify running cert tests and allow filtering, auto build" am: 6a466e98

Change-Id: I79ee3131e95edf5acb868a3c1e8d81bbb0a51584
parents 7acff28c 6a466e98
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3,11 +3,12 @@ LOCAL_PATH := $(call my-dir)
bluetooth_cert_test_file_list := \
    $(call all-named-files-under,*.py,cert) \
    $(call all-named-files-under,*.sh,cert) \
    $(call all-named-files-under,run,cert) \
    $(call all-named-files-under,*.proto,cert facade hal hci/cert hci/facade l2cap/classic \
	    l2cap/classic/cert neighbor/facade security) \
    cert/cert_testcases_facade_only \
    cert/all_cert_testcases \
    cert/android_devices_config.json \
    cert/host_only_config_facade_only.json \
    cert/host_config.json \
    hal/cert/simple_hal_test.py \
    hci/cert/acl_manager_test.py \
    hci/cert/controller_test.py \

system/gd/cert/run

0 → 100755
+44 −0
Original line number Diff line number Diff line
#! /bin/bash

if [[ -z "${ANDROID_BUILD_TOP}" ]]; then
  echo "ANDROID_BUILD_TOP is not set"
fi

if [[ -z "${ANDROID_HOST_OUT}" ]]; then
  echo "ANDROID_HOST_OUT is not set for host run"
fi

$ANDROID_BUILD_TOP/build/soong/soong_ui.bash --build-mode --"all-modules" --dir="$(pwd)" dist bluetooth_stack_with_facade

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"

POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
    --test_filter=*)
    TEST_FILTER="-tc ${key#*=}"
    shift # past argument=value
    ;;
    --host)
    TEST_CONFIG=$ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/cert/host_config.json
    shift # past argument
    ;;
    *)    # unknown option
    POSITIONAL+=("$1") # save it in an array for later
    shift # past argument
    ;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters

unzip -o -q $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py.zip \
   -d $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py

PYTHONPATH=$PYTHONPATH:$ANDROID_BUILD_TOP/out/host/linux-x86/lib64:$ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd:$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py \
    python3.8 `which act.py`\
      -c $TEST_CONFIG \
      $TEST_FILTER \
      -tp $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd
+0 −13
Original line number Diff line number Diff line
#! /bin/bash

if [[ -z "${ANDROID_BUILD_TOP}" ]]; then
  echo "ANDROID_BUILD_TOP is not set"
fi

if [[ -z "${ANDROID_HOST_OUT}" ]]; then
  echo "ANDROID_HOST_OUT is not set for host run"
fi

unzip -o -q $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py.zip -d $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py

PYTHONPATH=$PYTHONPATH:$ANDROID_BUILD_TOP/out/host/linux-x86/lib64:$ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd:$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py python3.8 `which act.py` -c $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/cert/host_only_config_facade_only.json -tf $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/cert/cert_testcases_facade_only -tp $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd
Loading