diff --git a/app/src/androidTest/java/app/opendocument/droid/test/ScreenshotTests.kt b/app/src/androidTest/java/app/opendocument/droid/test/ScreenshotTests.kt index 2cadd02cb36d..7b70c9d54f41 100644 --- a/app/src/androidTest/java/app/opendocument/droid/test/ScreenshotTests.kt +++ b/app/src/androidTest/java/app/opendocument/droid/test/ScreenshotTests.kt @@ -86,7 +86,7 @@ import org.junit.runner.RunWith * ./gradlew connectedProDebugAndroidTest \ * -Pandroid.testInstrumentationRunnerArguments.class=app.opendocument.droid.test.ScreenshotTests \ * -Pandroid.testInstrumentationRunnerArguments.device=phone \ - * -Pandroid.testInstrumentationRunnerArguments.locales=en-US,de-DE + * -Pandroid.testInstrumentationRunnerArguments.locales=en-US+de-DE * ``` * * Wants android 15 or newer, and says so rather than photographing what an older one draws. @@ -599,7 +599,11 @@ class ScreenshotTests { // --- what the run was asked for ----------------------------------------- - /** The locales to photograph: every one the listing is written in, unless fewer were named. */ + /** + * The locales to photograph: every one the listing is written in, unless fewer were named. + * + * A plus separates them as well as a comma, which AGP 9.4.0 cuts such a property at. + */ private fun locales(spoken: JSONObject): List { val known = spoken.keys().asSequence().sorted().toList() @@ -608,7 +612,7 @@ class ScreenshotTests { return known } - val wanted = given.split(",").map { it.trim() }.filter { it.isNotEmpty() } + val wanted = given.split(',', '+').map { it.trim() }.filter { it.isNotEmpty() } val unknown = wanted.filterNot { it in known } Assert.assertTrue( "no such locale: ${unknown.joinToString()}. One of ${known.joinToString()}", diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 28204ca10a56..0efd4f19f6fe 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -330,7 +330,8 @@ platform :android do "android.testInstrumentationRunnerArguments.class" => "app.opendocument.droid.test.ScreenshotTests", "android.testInstrumentationRunnerArguments.device" => device, - "android.testInstrumentationRunnerArguments.locales" => languages.join(",") + # a plus, not a comma: AGP 9.4.0 cuts one of these at the first comma + "android.testInstrumentationRunnerArguments.locales" => languages.join("+") } ) @@ -342,6 +343,16 @@ platform :android do ) end + # a short list photographs as a complete run, so the count is what catches it. + # Per language rather than as a set, which a release runner does not have. + missing = languages - taken.map { |path| File.basename(File.dirname(path)) }.uniq + unless missing.empty? + UI.user_error!( + "the run photographed #{missing.length} of #{languages.length} languages: " \ + "nothing came out for #{missing.join(', ')}" + ) + end + FileUtils.mkdir_p(SCREENSHOT_DIR) taken.each do |path| locale = File.basename(File.dirname(path))