3

I've written some unit tests in my Android projects with Robolectric, and some of them even don't use Android.

I've tried first this: robolectric-gradle-plugin, following this template. The result is that I've faced this bug in IDEA, that I reported myself.

Then I've tried another possibility: the gradle-android-test-plugin, which separates tests in another submodule, that is a regular Java project. I've tried to follow this other template. I've open this bug report.

Then I've faced again with other bug.

What recommendations can you provide me, that does work?

4

1 回答 1

0

最后我不得不将 IDEA 升级到 14 EAP,并且知道它可以正常工作。

gradle-android-test-plugin 似乎比 robolectric 插件更好,因为我可以轻松运行 JUnit 和 ScalaTest 测试。我不得不安装一个脚本,即未发布的 com.novoda:gradle-android-test-plugin:0.9.9-SNAPSHOT。

这是以下版本的组合:

  • Android 构建工具
  • 摇篮
  • com.android.tools.build:gradle
  • 主意
  • 机器人电动
  • robolectric 插件
  • ……

其中之一的任何更改都可能使您的项目失败。

幸运的是,通过使用 Gradle,您可以修复每个组件的版本,并进行持续集成。

于 2014-07-16T10:16:00.547 回答