-
Notifications
You must be signed in to change notification settings - Fork 17
Resource files not picked up in test variant #4
Comments
Right now, test resources are not supported at all. |
Hi, |
@klassm No work so far. I do have a rough idea of what needs to be done. |
Well this would be absolutely a wonderful feature :-) |
I did make a bit of progress on this. Resource directories are now marked correctly if you are on the latest version of the gradle plugin. However, they are still not added to the classpath. I think its because the build dir is set up differently than a standard java project due to flavors. I can't seem to find a way to modify the classpath of the test runner to account for this. If you are really dieing for this feature, you could probably hack something together with a task that copies the resources into test-classes. |
@tommyd3mdi @klassm This will probably never be implemented because it requires recreating the entire classpath for the junit test runner. Intellij 14 has a new gradle test runner that solves this (and several other problems). So your best bet is to use that, or wait until the changes get rolled into Android Studio. |
Ok great. Thanks! |
Reopening so others can find it. |
Actually (AS 1.0-RC) the main resource folder it's find correctly, but their flavor counterpart not |
You can fix this by copying the test resources via build.gradle:
|
Robolectric allows to place its configuration in a special config file
org.robolectric.Config.properties
that usually resides insrc/test/resources
. While this is correctly picked up when I execute./gradlew test
on command line, it isn't when I run the test through Android Studio.The text was updated successfully, but these errors were encountered: