forked from ankidroid/Anki-Android
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: copy testlib common files into androidTest directly
we are unable to depend on them in androidTestImplementation terms because android gradle plugin has a bug that breaks coverage with a shared test/androidTest dep we want the code to be truly shared though and just need to work around the issue temporarily (we hope) so a build-time copy seems the least-worst alternative
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
AnkiDroid/src/androidTest/java/com/ichi2/testutils/common/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# The files in this directory are copied from testlib dynamically during build | ||
# Copy used instead of `androidTestImplementation(':testlib')` until android gradle plugin | ||
# issue that breaks coverage for shared test/androidTest deps is fixed | ||
# see https://issuetracker.google.com/issues/332746900#comment2 | ||
*.kt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Fixup build / test errors as needed | ||
#git cherry-pick 8a1c48d0ab2978d76e53774ff9b4e0ea2986cdfb --allow-empty --no-commit --no-gpg-sign | ||
|
||
# Run the test | ||
./gradlew jacocoAndroidTestReport | ||
|
||
# Was there coverage? | ||
cat AnkiDroid/build/reports/jacoco/jacocoAndroidTestReport/jacocoAndroidTestReport.xml |grep 'covered="0"/></report>' > /dev/null | ||
if [ $? == 0 ]; then | ||
echo no coverage detected | ||
exit 1 | ||
else | ||
echo there appears to be coverage | ||
fi | ||
|
||
exit 0 |