How to make testing work under Android Studio


It's such a pain to look for solutions for tasks on Android Studio. When can it be mature enough and more well documented for developers?

I would like to write some test cases for my small app, but I couldn't find a way for adding test cases into Android Studio project and have it run successfully.

After wandering around on the internet for a long time, eventually I found a link that did helped me out (see reference below). As Google I/O 2013 video said, a new android build system made of gradle is released, which will be more flexible, more powerful, more etc, etc. However, currently, it 's not well integrated into Android Studio. Some modification in Android Studio won't be directly reflected in gradle build scripts. Well... then, how do I know when I should modify build scripts my self? And to write it by myself, I have to learn groovy first, because that's the language Gradle used to write its build configuration files. How could I master these things in a short time...

Anyway, the solution for my pain point above is to modify build.gradle under the root directory of app project, and make sure all the instrument source folders are well set up. Now I can use cradle to run test cases and generate report files. However, I can't make it work in Android Studio still. orz...


No comments:

Post a Comment


不是很好看。以為 Jake Gyllenhaal 有演出,應該會有點看頭的。 故事是在講一群太空人在太空站上試著培養火星來的休眠單細胞生物,最後愈搞愈大,變得不可收拾的地步。 中間很多故做緊張的情節,但因為張力不夠,再加上配樂又不是很優(也有可能是因為在家看的關係,聲光效...