66# LICENSE file in the root directory of this source tree.
77
88# CI test script for running instrumentation tests with pre-downloaded models
9- # Usage: ./run-ci-tests.sh <model_preset> <model_file> <tokenizer_file>
9+ # Usage: ./run-ci-tests.sh <model_preset> <model_file> <tokenizer_file> [use_local_aar]
1010#
1111# This script is designed for CI environments where models are pre-downloaded
1212# to /tmp/llama_models/ before the emulator starts.
@@ -16,11 +16,13 @@ set -ex
1616MODEL_PRESET=" $1 "
1717MODEL_FILE=" $2 "
1818TOKENIZER_FILE=" $3 "
19+ USE_LOCAL_AAR=" ${4:- false} "
1920
2021echo " === Test Configuration ==="
2122echo " MODEL_PRESET: $MODEL_PRESET "
2223echo " MODEL_FILE: $MODEL_FILE "
2324echo " TOKENIZER_FILE: $TOKENIZER_FILE "
25+ echo " USE_LOCAL_AAR: $USE_LOCAL_AAR "
2426
2527echo " === Emulator Memory Info ==="
2628adb shell cat /proc/meminfo | head -5
@@ -90,9 +92,11 @@ adb logcat > /tmp/logcat.txt &
9092LOGCAT_PID=$!
9193
9294echo " === Starting Gradle ==="
93- ./gradlew connectedCheck \
94- -PskipModelDownload=true \
95- -PmodelPreset=" $MODEL_PRESET "
95+ GRADLE_ARGS=" -PskipModelDownload=true -PmodelPreset=\" $MODEL_PRESET \" "
96+ if [ " $USE_LOCAL_AAR " = " true" ]; then
97+ GRADLE_ARGS=" $GRADLE_ARGS -PuseLocalAar=true"
98+ fi
99+ eval ./gradlew connectedCheck " $GRADLE_ARGS "
96100TEST_EXIT_CODE=$?
97101
98102echo " === Model directory after Gradle ==="
0 commit comments