Skip to content

Commit

Permalink
add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
niqdev committed Jul 19, 2016
1 parent faff494 commit 713e54b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#Dagger 2 and Realm unit test

[![Build Status](https://travis-ci.org/niqdev/dagger-realm-test.svg?branch=master)](https://travis-ci.org/niqdev/dagger-realm-test)
[![Coverage Status](https://coveralls.io/repos/github/niqdev/dagger-realm-test/badge.svg?branch=master)](https://coveralls.io/github/niqdev/dagger-realm-test?branch=master)

:tada: Updated with Realm v1.x!!
:tada: Updated with Realm v1.x!! [Robolectric/Realm issue](https://github.com/robolectric/robolectric/issues/1389)

Sample Android application of Dagger 2 and Realm tested with Robolectric, Mockito and PowerMockito.
Sample Android application of [Dagger 2](http://google.github.io/dagger/) and [Realm](https://realm.io/docs/java/latest/) tested with [Robolectric](http://robolectric.org/), [Mockito](http://mockito.org/) and [PowerMockito](https://github.com/jayway/powermock).

Example
```java
Expand Down
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'realm-android'
apply from: '../coverage.gradle'

android {
compileSdkVersion 24
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ buildscript {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'io.realm:realm-gradle-plugin:1.1.0'
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.5.0'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
}
}

Expand Down
17 changes: 17 additions & 0 deletions coverage.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ./gradlew jacocoTestReportDebug

apply plugin: 'com.vanniktech.android.junit.jacoco'
apply plugin: 'com.github.kt3k.coveralls'

junitJacoco {
jacocoVersion = '0.7.7.201606060606'
}

coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/debug/jacoco.xml"
}

tasks.coveralls {
dependsOn 'connectedAndroidTest'
onlyIf { System.env.'CI' }
}

0 comments on commit 713e54b

Please sign in to comment.