Skip to content

Commit

Permalink
feat(test): add jacoco report
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Nov 2, 2019
1 parent 25eb085 commit d3b4c5c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
36 changes: 36 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ allprojects {
apply plugin:"java"
apply plugin:"net.ltgt.apt-eclipse"
apply plugin:"net.ltgt.apt-idea"
apply plugin: "jacoco"

// test
apply plugin:"com.adarshr.test-logger"
Expand Down Expand Up @@ -150,4 +151,39 @@ jar {

shadowJar {
mergeServiceFiles()
}


/**********************************************************************************************************************\
* Jacoco
**********************************************************************************************************************/
subprojects {
test {
finalizedBy jacocoTestReport
}

jacoco {
toolVersion = "0.8.4"
}

jacocoTestReport {
getAdditionalSourceDirs().setFrom(files(sourceSets.main.allSource.srcDirs))
getSourceDirectories().setFrom(files(sourceSets.main.allSource.srcDirs))
getClassDirectories().setFrom(files(sourceSets.main.output))
}
}

task jacoco(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = subprojects.test

getAdditionalSourceDirs().setFrom(files(subprojects.sourceSets.main.allSource.srcDirs))
getSourceDirectories().setFrom(files(subprojects.sourceSets.main.allSource.srcDirs))
getClassDirectories().setFrom(files(subprojects.sourceSets.main.output))
getExecutionData().setFrom(files(subprojects.jacocoTestReport.executionData))

reports {
html.enabled = true
xml.enabled = true
csv.enabled = true
}
}
12 changes: 12 additions & 0 deletions cli/src/test/java/org/floworc/cli/TodoTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.floworc.cli;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertTrue;

class TodoTest {
@Test
void todo() {
assertTrue(true);
}
}
1 change: 1 addition & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true
lombok.anyConstructor.addConstructorProperties = true
lombok.equalsAndHashCode.callSuper = call
Expand Down

0 comments on commit d3b4c5c

Please sign in to comment.