2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AndroidStudio上でSpekとJUnit4の共存

Posted at

ここに従って、JUnit4でもSpek実行できるようにすると、逆にJUnitで書いてあったテストが
Android Studio上で Empty test suite. と出て実行できなくなる。
./gradlew test では実行できる。

調べてみると、

Spekが実行できる状態のログ.txt
〜/mockable-android-27.v3.jar" com.intellij.rt.execution.application.AppMainV2 com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit5 <テストクラス>
Spekが実行できない場合のログ.txt
〜/mockable-android-27.v3.jar" com.intellij.rt.execution.application.AppMainV2 com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 <テストクラス>

と、Spekが実行できる場合にコマンドのオプションで -junit5 というのがついている。

どうやら、JUnit5上でテストを実行しているようなので、 公式 を参考に、JUnit5上でJUnit4形式のテストを動かすエンジンを入れたらテストの実行は出来た

ToDo

他に確認しといたほうがいいこと

  • Robolectricがちゃんと動くのか?
  • espressoがちゃんと動くのか?
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?