Skip to content

Move test sources to androidTest so they are discoverable#209

Open
jselbo wants to merge 1 commit intolinkedin:mainfrom
jselbo:testfix
Open

Move test sources to androidTest so they are discoverable#209
jselbo wants to merge 1 commit intolinkedin:mainfrom
jselbo:testfix

Conversation

@jselbo
Copy link

@jselbo jselbo commented Mar 4, 2026

All the test sub-projects (except dexmaker-tests) had sources in src/main/java, making them compile as library code rather than instrumentation tests. This was apparently done in 8524de2 intentionally, but as far as I can tell it left the tests unrunnable from connectedAndroidTest task.

Move test sources to src/androidTest/java and update dependencies to androidTestImplementation so the test runner can discover them.

Before:
./gradlew connectedAndroidTest
only runs dexmaker-tests tests

After:

> Task :dexmaker-tests:connectedDebugAndroidTest
Finished 157 tests on Pixel_5(AVD) - 11

> Task :dexmaker-mockito-tests:connectedDebugAndroidTest
Finished 30 tests on Pixel_5(AVD) - 11

> Task :dexmaker-mockito-inline-extended-tests:connectedDebugAndroidTest
Finished 41 tests on Pixel_5(AVD) - 11

> Task :dexmaker-mockito-inline-tests:connectedDebugAndroidTest
Finished 37 tests on Pixel_5(AVD) - 11

The test classes in dexmaker-mockito-inline-tests and
dexmaker-mockito-inline-extended-tests were in src/main/java, making
them compile as library code rather than instrumentation tests. This
was done in 8524de2 to allow cross-module inclusion via Gradle
dependencies instead of symlinks, but left the tests unrunnable from
Gradle's connectedDebugAndroidTest task.

Move test sources to src/androidTest/java and update dependencies to
androidTestImplementation so the test runner can discover them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant