|
| 1 | +package org.scoverage |
| 2 | + |
| 3 | +import org.junit.Test |
| 4 | + |
| 5 | +class AggregationAcceptanceTest extends AcceptanceTestUtils { |
| 6 | + |
| 7 | + private static File aggregateReportDir(File baseDir) { |
| 8 | + return new File(baseDir, 'build/scoverage-aggregate') |
| 9 | + } |
| 10 | + |
| 11 | + private testWater(boolean useAnt) throws Exception { |
| 12 | + File projectDir = new File('src/test/water') |
| 13 | + |
| 14 | + def build = setupBuild(projectDir, useAnt) |
| 15 | + build.forTasks('clean', 'reportScoverage', 'aggregateScoverage').run() |
| 16 | + |
| 17 | + def indexHtml = new File(aggregateReportDir(projectDir), 'index.html') |
| 18 | + checkFile('an aggregated index HTML file', indexHtml, true) |
| 19 | + |
| 20 | + def cobertura = new File(aggregateReportDir(projectDir), 'cobertura.xml') |
| 21 | + checkFile('an aggregated cobertura XML file', cobertura, true) |
| 22 | + |
| 23 | + def scoverageXml = new File(aggregateReportDir(projectDir), 'scoverage.xml') |
| 24 | + checkFile('an aggregated scoverage XML file', scoverageXml, true) |
| 25 | + |
| 26 | + def krillsHtml = new File(aggregateReportDir(projectDir), 'krills.html') |
| 27 | + checkFile('a HTML file for \'krills\' sub-project', krillsHtml, true) |
| 28 | + |
| 29 | + def whalesHtml = new File(aggregateReportDir(projectDir), 'whales.html') |
| 30 | + checkFile('a HTML file for \'whales\' sub-project', whalesHtml, true) |
| 31 | + } |
| 32 | + |
| 33 | + @Test |
| 34 | + public void testMultiProjectAggregationWithAnt() throws Exception { |
| 35 | + testWater(true) |
| 36 | + } |
| 37 | + |
| 38 | + @Test |
| 39 | + public void testMultiProjectAggregationWithZinc() throws Exception { |
| 40 | + testWater(false) |
| 41 | + } |
| 42 | +} |
0 commit comments