My current Gradle configuration has multiple (Merged) res folders:
sourceSets {
androidTest {
setRoot(\'src/test\')
}
main {
res.
Another solution similar to Luca's:
public class MyTestRunner extends RobolectricTestRunner {
...
@Override
protected AndroidManifest getAppManifest(Config config) {
String appRoot = "./src/main/";
String manifestPath = appRoot + "AndroidManifest.xml";
String resDir = appRoot + "res";
String assetsDir = appRoot + "assets";
return new AndroidManifest(Fs.fileFromPath(manifestPath), Fs.fileFromPath(resDir), Fs.fileFromPath(assetsDir)) {
@Override
public List getIncludedResourcePaths() {
List paths = super.getIncludedResourcePaths();
paths.add(new ResourcePath(getRClass(), getPackageName(), Fs.fileFromPath("../app/src/main/res/features/registration"), getAssetsDirectory()));
paths.add(new ResourcePath(getRClass(), getPackageName(), Fs.fileFromPath("../app/src/main/res/features/login"), getAssetsDirectory()));
return paths;
}
};
}
}
Don't forget to annotate your tests with @RunWith(MyTestRunner.class)