SuperTextView

Standalone Android regression tests

This directory is a separate Gradle root. It compiles the real library/src/main/java, library/src/main/res and library/src/main/AndroidManifest.xml, and runs tests from library/src/test/java. It does not evaluate or migrate the repository’s legacy AGP 3.3 / JCenter build files. The only additional main resource is an XML inflation fixture local to this test build.

Requirements

Set ANDROID_HOME (or an untracked regression-tests/local.properties) for your SDK installation. Never commit a machine-specific SDK path. GRADLE_75 below is the path to the Gradle 7.5 executable, such as one from an already cached distribution.

From the repository root:

export JAVA_HOME=$(/usr/libexec/java_home -v 11) # macOS; select JDK 11 normally elsewhere
export ANDROID_HOME=/path/to/your/android-sdk
export GRADLE_75=/path/to/gradle-7.5/bin/gradle

"$GRADLE_75" -p regression-tests testDebugUnitTest --console=plain

Run only the four issue regressions:

"$GRADLE_75" -p regression-tests testDebugUnitTest \
  --tests com.coorchice.library.SuperTextViewRegressionTest --console=plain

Reproduce the unfixed baseline without changing shared source files

"$GRADLE_75" -p regression-tests -Pbaseline=true testDebugUnitTest \
  --tests com.coorchice.library.SuperTextViewRegressionTest --console=plain

-Pbaseline=true exports Java sources from the current Git HEAD with git archive into ignored build/baseline/baseline-sources, then runs exactly the same tests. It never checks out/reverts files or writes into library/src/main. This is useful while fixes are uncommitted; after committing fixes, HEAD is no longer an unfixed baseline. Normal reports are in build/reports/tests/testDebugUnitTest/; baseline reports are separately retained in build/baseline/reports/tests/testDebugUnitTest/.

What is observed

The standalone build also supports other tests in library/src/test/java, including Mockito-based tests; GIF native binaries are not loaded by the regular-drawable tests.

Remaining-issue and device coverage

FontAndOverdrawRegressionTest adds 14 contracts for #89 and #91: transparent path submissions, visible/translucent/gradient fills, drawable and press geometry, and XML-inherited typeface preservation. These record drawing commands/typeface, not GPU overdraw or legacy Robolectric glyph-width estimates. See the investigation and limits.

The same build can produce a self-contained library instrumentation APK (no AndroidX test runner or separate application APK). It includes the real production Java/resources/native libraries and tests both XML image slots, rounded image pixels, real platform fonts, drawing commands and repeated diagnostics:

"$GRADLE_75" -p regression-tests assembleDebugAndroidTest --console=plain
adb -s <serial> install -r build/outputs/apk/androidTest/debug/SuperTextView-regression-tests-debug-androidTest.apk
adb -s <serial> shell am instrument -w -r \
  com.coorchice.library.test/com.coorchice.library.DeviceRegressionInstrumentation

Run installation from this directory, or prefix the APK with regression-tests/ from the repository root. Do not trust the shell exit alone: require DEVICE_SUMMARY passed=15 failed=0 total=15 and INSTRUMENTATION_CODE: -1. The recorded device run used API 35; it is not API-19/OEM compatibility coverage.

The build and legacy library both apply gradle/native-validation.gradle. Source builds require Python 3 (-PstvPython=... overrides it): native payloads are checked before preBuild and the final AAR is checked after bundling. CI also runs the AAR CLI check explicitly and tests these device cases in its emulator matrix. Consuming an existing published AAR has no new Python requirement.