From dafdde5439958b803d7c2d73663023756e23e46c Mon Sep 17 00:00:00 2001
From: Hallvard Traetteberg <hal@ntnu.no>
Date: Wed, 10 Jan 2018 14:46:23 +0100
Subject: [PATCH] Added instructions to use jacoco (pom and ci yml), for issue
 #8

---
 .gitlab-ci.yml                  |  1 +
 tdt4140-gr1800/app.core/pom.xml | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 576e8ba..270ea75 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,6 +24,7 @@ unittest-job:
     - build-job
   script:
     - "mvn package -f tdt4140-gr1800/pom.xml $MAVEN_CLI_OPTS"
+    - "cat tdt4140-gr1800/target/site/jacoco/index.html"
 
 integrationtest-job:
   stage: test
diff --git a/tdt4140-gr1800/app.core/pom.xml b/tdt4140-gr1800/app.core/pom.xml
index b043414..985bded 100644
--- a/tdt4140-gr1800/app.core/pom.xml
+++ b/tdt4140-gr1800/app.core/pom.xml
@@ -33,4 +33,30 @@
 			<scope>test</scope>
 		</dependency>
 	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.jacoco</groupId>
+				<artifactId>jacoco-maven-plugin</artifactId>
+				<version>0.8.0</version>
+				<executions>
+					<execution>
+						<id>pre-unit-test</id>
+						<goals>
+							<goal>prepare-agent</goal>
+						</goals>
+					</execution>
+					<execution>
+						<id>post-unit-test</id>
+						<phase>test</phase>
+						<goals>
+							<goal>report</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+
 </project>
\ No newline at end of file
-- 
GitLab