2018-04-24 10:49:42 [SR.runTests] Executing instrumentation suite on 3 device(s).
Exception in thread "main" java.lang.RuntimeException: Error while merging coverage files. Did you set the "testCoverageEnabled" flag in your build.gradle?
at com.squareup.spoon.SpoonRunner.run(SpoonRunner.java:141)
at com.squareup.spoon.SpoonRunner.main(SpoonRunner.java:695)
Caused by: java.io.FileNotFoundException: spoon-output\coverage\emulator-5556\coverage.ec
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.jacoco.core.tools.ExecFileLoader.load(ExecFileLoader.java:71)
at com.squareup.spoon.SpoonCoverageMerger.mergeCoverageFiles(SpoonCoverageMerger.java:28)
at com.squareup.spoon.SpoonRunner.run(SpoonRunner.java:138)
... 1 more
Problem:
I use command gradle clean createDebugCoverageReport,it can create coverage.ec files. And I use the same apk file to spoon, it not works.
Use Jar: runner-1.7.1.jar
Command:
java -jar spoon-runner-1.7.1.jar --apk ps_lib-tests-debug.apk --test-apk ps_lib-tests-debug-androidTest.apk --grant-all --coverage true
build.gradle:
log:
Problem: I use command
gradle clean createDebugCoverageReport
,it can create coverage.ec files. And I use the same apk file to spoon, it not works.