diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2016-05-25 13:44:18 +0200 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2016-05-25 13:57:59 +0200 |
commit | 55e39fce6f09574956db99dddc2cbbcb055281fa (patch) | |
tree | e4b0e7582ad449c02bfc5efee9ca2e9680efcb01 /jacoco-maven-plugin.test | |
parent | 0cefebecbd463e541ffc7b622c793a3f5e57ba64 (diff) | |
download | jacoco-55e39fce6f09574956db99dddc2cbbcb055281fa.tar.gz |
GitHub #414: Also collect execution data from the project itself.
Diffstat (limited to 'jacoco-maven-plugin.test')
-rw-r--r-- | jacoco-maven-plugin.test/it/it-report-aggregate/report/src/test/java/packagereport/ReportTest.java | 22 | ||||
-rw-r--r-- | jacoco-maven-plugin.test/it/it-report-aggregate/verify.bsh | 11 |
2 files changed, 30 insertions, 3 deletions
diff --git a/jacoco-maven-plugin.test/it/it-report-aggregate/report/src/test/java/packagereport/ReportTest.java b/jacoco-maven-plugin.test/it/it-report-aggregate/report/src/test/java/packagereport/ReportTest.java new file mode 100644 index 00000000..a1be3ed4 --- /dev/null +++ b/jacoco-maven-plugin.test/it/it-report-aggregate/report/src/test/java/packagereport/ReportTest.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2009, 2016 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc R. Hoffmann - initial API and implementation + * + *******************************************************************************/ +package packagereport; + +import org.junit.Test; + +public class ReportTest { + + @Test + public void test() { + } + +} diff --git a/jacoco-maven-plugin.test/it/it-report-aggregate/verify.bsh b/jacoco-maven-plugin.test/it/it-report-aggregate/verify.bsh index 10e020fa..fbccdddf 100644 --- a/jacoco-maven-plugin.test/it/it-report-aggregate/verify.bsh +++ b/jacoco-maven-plugin.test/it/it-report-aggregate/verify.bsh @@ -10,21 +10,26 @@ * *******************************************************************************/ import org.codehaus.plexus.util.*; +import java.util.regex.*; String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); -if ( buildLog.indexOf( "/child1/target/jacoco.exec".replace('/', File.separatorChar) ) < 0 ) { +if ( !Pattern.compile( "Loading execution data file \\S*child1.target.jacoco.exec").matcher( buildLog ).find() ) { throw new RuntimeException( "Execution data from child1 was not loaded." ); } -if ( buildLog.indexOf( "/child1-test/target/jacoco.exec".replace('/', File.separatorChar) ) < 0 ) { +if ( !Pattern.compile( "Loading execution data file \\S*child1-test.target.jacoco.exec").matcher( buildLog ).find() ) { throw new RuntimeException( "Execution data from child1-test was not loaded." ); } -if ( buildLog.indexOf( "/child2/target/jacoco.exec".replace('/', File.separatorChar) ) < 0 ) { +if ( !Pattern.compile( "Loading execution data file \\S*child2.target.jacoco.exec").matcher( buildLog ).find() ) { throw new RuntimeException( "Execution data from child2 was not loaded." ); } +if ( !Pattern.compile( "Loading execution data file \\S*report.target.jacoco.exec").matcher( buildLog ).find() ) { + throw new RuntimeException( "Execution data from report was not loaded." ); +} + File reportChild1 = new File( basedir, "report/target/site/jacoco-aggregate/child1/index.html" ); if ( !reportChild1.isFile() ) { throw new RuntimeException( "Report for child1 was not created." ); |