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.
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
"$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/.
Engine captures callbacks to reproduce A→B→A out-of-order completion and
a manual placeholder assignment superseding a pending image request; no network
request or production request-token reflection is needed.Canvas observes the actual TextPaint passed by platform
BoringLayout for plain single-line text during repeated real View.draw() calls.
This avoids both incomplete legacy ShadowPaint.set(Paint) copying in the
span/TextLine path and native-renderer API 28 incompatibilities. It checks one correctly
colored stroke pass and one fill pass (including gradient fill), restores the
original stateful ColorStateList and paint style/width/color/shader, and checks
that drawing neither invalidates itself nor requests layout/mutates font padding.
No private TextView reflection, private draw-method calls or production hook
visibility changes are used; views are attached to an Activity and measured.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.
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.