aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorbcorso <bcorso@google.com>2020-07-13 15:14:48 -0700
committerDavid P. Baker <dpb@google.com>2020-07-14 14:37:50 -0400
commit09d60be0f64fd039ac3c065bc585f37679fe6486 (patch)
treeb8f6d17c271f1fb8042c070a3309cc5d28dbb92f /util
parent29e080f0bac71581ab5f8848d1495af72aecc697 (diff)
downloaddagger2-09d60be0f64fd039ac3c065bc585f37679fe6486.tar.gz
Add artifact tests to javatests/artifacts
RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=321043804
Diffstat (limited to 'util')
-rwxr-xr-xutil/run-local-emulator-tests.sh11
-rwxr-xr-xutil/run-local-tests.sh36
2 files changed, 29 insertions, 18 deletions
diff --git a/util/run-local-emulator-tests.sh b/util/run-local-emulator-tests.sh
index 5af33bda2..e2b0fc4be 100755
--- a/util/run-local-emulator-tests.sh
+++ b/util/run-local-emulator-tests.sh
@@ -12,7 +12,6 @@ readonly EMULATOR="$1"
# Empirically, the emulator startup takes ~60s so we set the timeout for 200s.
readonly TIMEOUT_SEC=200
readonly WAIT_CMD="${ANDROID_HOME}/platform-tools/adb wait-for-device shell getprop init.svc.bootanim"
-readonly _HILT_ANDROID_EXAMPLE_DIR=java/dagger/hilt/android/example/gradle/simple
# Start the emulator in the background and grab its PID so we can kill it later.
${ANDROID_HOME}/emulator/emulator -avd $EMULATOR -no-window -wipe-data &
@@ -49,6 +48,10 @@ until $WAIT_CMD | grep -m 1 stopped; do
sleep 1
done
-echo "Running gradle tests"
-# Run the emulator tests in the given directory
-./$_HILT_ANDROID_EXAMPLE_DIR/gradlew -p $_HILT_ANDROID_EXAMPLE_DIR connectedAndroidTest --no-daemon --stacktrace
+readonly GRADLE_PROJECTS=(
+ "javatests/artifacts/hilt-android/simple"
+)
+for project in "${GRADLE_PROJECTS[@]}"; do
+ echo "Running gradle tests for $project"
+ ./$project/gradlew -p $project connectedAndroidTest --no-daemon --stacktrace
+done
diff --git a/util/run-local-tests.sh b/util/run-local-tests.sh
index 9adef2940..0ed880f92 100755
--- a/util/run-local-tests.sh
+++ b/util/run-local-tests.sh
@@ -12,24 +12,32 @@ util/install-local-snapshot.sh
pushd examples/maven && mvn compile && popd
-# Also run the gradle examples on the local maven snapshots.
-readonly _SIMPLE_EXAMPLE_DIR=java/dagger/example/gradle/simple
-readonly _ANDROID_EXAMPLE_DIR=java/dagger/example/gradle/android/simple
-./$_SIMPLE_EXAMPLE_DIR/gradlew -p $_SIMPLE_EXAMPLE_DIR build --no-daemon --stacktrace
-./$_ANDROID_EXAMPLE_DIR/gradlew -p $_ANDROID_EXAMPLE_DIR build --no-daemon --stacktrace
+readonly GRADLE_PROJECTS=(
+ "java/dagger/example/gradle/simple"
+ "java/dagger/hilt/android/plugin"
+ "javatests/artifacts/dagger/simple"
+)
+for project in "${GRADLE_PROJECTS[@]}"; do
+ echo "Running gradle tests for $project"
+ ./$project/gradlew -p $project build --no-daemon --stacktrace
+ ./$project/gradlew -p $project test --no-daemon --stacktrace
+done
+
-readonly _HILT_GRADLE_PLUGIN_DIR=java/dagger/hilt/android/plugin
-readonly _HILT_ANDROID_EXAMPLE_DIR=java/dagger/hilt/android/example/gradle/simple
-readonly _HILT_KOTLIN_ANDROID_EXAMPLE_DIR=java/dagger/hilt/android/example/gradle/simpleKotlin
-./$_HILT_GRADLE_PLUGIN_DIR/gradlew -p $_HILT_GRADLE_PLUGIN_DIR test --no-daemon --stacktrace
# Run gradle tests with different versions of Android Gradle Plugin
readonly AGP_VERSIONS=("4.1.0-alpha07" "4.0.0-beta05" "3.6.3")
+readonly ANDROID_GRADLE_PROJECTS=(
+ "java/dagger/example/gradle/android/simple"
+ "javatests/artifacts/dagger-android/simple"
+ "javatests/artifacts/hilt-android/simple"
+ "javatests/artifacts/hilt-android/simpleKotlin"
+)
for version in "${AGP_VERSIONS[@]}"; do
- echo "Running tests with AGP $version"
- AGP_VERSION=$version ./$_HILT_ANDROID_EXAMPLE_DIR/gradlew -p $_HILT_ANDROID_EXAMPLE_DIR buildDebug --no-daemon --stacktrace
- AGP_VERSION=$version ./$_HILT_ANDROID_EXAMPLE_DIR/gradlew -p $_HILT_ANDROID_EXAMPLE_DIR testDebug --no-daemon --stacktrace
- AGP_VERSION=$version ./$_HILT_KOTLIN_ANDROID_EXAMPLE_DIR/gradlew -p $_HILT_KOTLIN_ANDROID_EXAMPLE_DIR buildDebug --no-daemon --stacktrace
- AGP_VERSION=$version ./$_HILT_KOTLIN_ANDROID_EXAMPLE_DIR/gradlew -p $_HILT_KOTLIN_ANDROID_EXAMPLE_DIR testDebug --no-daemon --stacktrace
+ for project in "${ANDROID_GRADLE_PROJECTS[@]}"; do
+ echo "Running gradle tests for $project with AGP $version"
+ AGP_VERSION=$version ./$project/gradlew -p $project buildDebug --no-daemon --stacktrace
+ AGP_VERSION=$version ./$project/gradlew -p $project testDebug --no-daemon --stacktrace
+ done
done
verify_version_file() {