• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3set -ex
4
5# Instrumentation tests log results to logcat, so enable it during test runs.
6adb logcat *:S TestRunner:V & LOGCAT_PID=$!
7
8readonly GRADLE_PROJECTS=(
9    "javatests/artifacts/hilt-android/simple"
10    "javatests/artifacts/hilt-android/simpleKotlin"
11)
12for project in "${GRADLE_PROJECTS[@]}"; do
13    echo "Running gradle Android emulator tests for $project"
14    ./$project/gradlew -p $project connectedAndroidTest --continue --no-daemon --stacktrace
15done
16
17# Run emulator tests in a project with configuration cache enabled
18# TODO(danysantiago): Once AGP 4.2.0 is stable, remove these project and enable
19# config cache in the other test projects.
20readonly CONFIG_CACHE_PROJECT="javatests/artifacts/hilt-android/gradleConfigCache"
21./$CONFIG_CACHE_PROJECT/gradlew -p $CONFIG_CACHE_PROJECT connectedAndroidTest --continue --no-daemon --stacktrace --configuration-cache
22
23# Close logcat
24if [ -n "$LOGCAT_PID" ] ; then kill $LOGCAT_PID; fi
25