I\'m trying to create Robolectric tests for an android project (heck, i\'d be happy to even make them unit tests)
I have the folder directory as:
MyA
Follow the guidelines available here :
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Testing
and here
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
Summary :
As the first link says you have to rename your test directory as instrumentTest so Studio can automatically detects the sourceSets for your test project
or
Alternate is you can have your tests directory in root(with you main directory) and sources in a manner like tests/java, as the second link says
instrumenttest.setRoot("tests")
in sourceSets configuration under android tag
From the document
Note: setRoot() moves the whole sourceSet (and its sub folders) to a new folder. This moves src/instrumentTest/* to tests/* This is Android specific and will not work on Java sourceSets.