BREAKING NEWS: Android Studio 1.1.0 now has built-in unit testing support. More details here: https://sites.google.com/a/android.com/tools/tech-docs/unit-testing-support
At first I know that there are very, very, very similar questions (even here on SO). Most of them are terribly outdated, so I ask a new new question, which should be relevant for Android Studio 0.8.x.
I know that there are some libraries that work somehow, but in almost every case I had no evidence that the information was up to date. I know that there is, for example, roboelectric , there are also some obsolete Jake Wharton, such as gradle-android-test-plugin or double-espresso , I also found RoboSpock and Deckard library . But none of them seem to have integration with Android Studio.
After a long repeated search, I found these two errors in all implementations:
- The class path is broken and must be hacked to run junit
- Junit tests cannot be debugged
What I'm looking for:
- I want to automatically test an algorithm (which is plain java)
- I want to check the integration in my android app.
- I need integration in Android Studio so I can go to code from stacktrace
- I want to execute test code
I also found a good hack that ran tests in gradle as an external task and pushed the results in AS so that the results could be displayed, but unfortunately I can not find this link again (and if I remember correctly this also did not work for me )
Do you guys have any fresh links? Does it work for you?
android android-studio unit-testing
rekire
source share