Skip to content

Commit 23caa3c

Browse files
authored
Merge pull request #127 from eyalroth/fix-cross-version-test
Fix the cross (scala) version test
2 parents 72bdc5a + f9e7137 commit 23caa3c

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

src/functionalTest/java/org.scoverage/ScalaMultiModuleCrossVersionTest.java

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,60 @@
55

66
import java.io.File;
77

8+
/**
9+
* Note that it is important to test the case of all of the modules together,
10+
* along with the cases of each module individually, as they behave differently.
11+
*/
812
public class ScalaMultiModuleCrossVersionTest extends ScoverageFunctionalTest {
913

1014
public ScalaMultiModuleCrossVersionTest() {
1115
super("scala-multi-module-cross-version");
1216
}
1317

1418
@Test
15-
public void checkAndAggregateScoverage() throws Exception {
19+
public void checkAndAggregateAll() throws Exception {
1620

1721
AssertableBuildResult result = run("clean", ScoveragePlugin.getCHECK_NAME(),
1822
ScoveragePlugin.getAGGREGATE_NAME());
1923

2024
result.assertTaskSkipped(ScoveragePlugin.getREPORT_NAME());
2125
result.assertTaskSucceeded("2_11:" + ScoveragePlugin.getREPORT_NAME());
2226
result.assertTaskSucceeded("2_12:" + ScoveragePlugin.getREPORT_NAME());
27+
result.assertTaskSucceeded("2_13:" + ScoveragePlugin.getREPORT_NAME());
2328
result.assertTaskSucceeded(ScoveragePlugin.getCHECK_NAME());
2429
result.assertTaskSucceeded("2_11:" + ScoveragePlugin.getCHECK_NAME());
2530
result.assertTaskSucceeded("2_12:" + ScoveragePlugin.getCHECK_NAME());
31+
result.assertTaskSucceeded("2_13:" + ScoveragePlugin.getCHECK_NAME());
2632
result.assertTaskSucceeded(ScoveragePlugin.getAGGREGATE_NAME());
2733

2834
assertAllReportFilesExist();
2935
assertCoverage(100.0);
3036
}
3137

38+
@Test
39+
public void report211() throws Exception {
40+
41+
AssertableBuildResult result = run("clean", ":2_11:" + ScoveragePlugin.getREPORT_NAME());
42+
result.assertTaskSucceeded("2_11:" + ScoveragePlugin.getREPORT_NAME());
43+
assert211ReportFilesExist();
44+
}
45+
46+
@Test
47+
public void report212() throws Exception {
48+
49+
AssertableBuildResult result = run("clean", ":2_12:" + ScoveragePlugin.getREPORT_NAME());
50+
result.assertTaskSucceeded("2_12:" + ScoveragePlugin.getREPORT_NAME());
51+
assert212ReportFilesExist();
52+
}
53+
54+
@Test
55+
public void report213() throws Exception {
56+
57+
AssertableBuildResult result = run("clean", ":2_13:" + ScoveragePlugin.getREPORT_NAME());
58+
result.assertTaskSucceeded("2_13:" + ScoveragePlugin.getREPORT_NAME());
59+
assert213ReportFilesExist();
60+
}
61+
3262
private void assertAllReportFilesExist() {
3363

3464
assert211ReportFilesExist();
@@ -42,6 +72,7 @@ private void assertAggregationFilesExist() {
4272
Assert.assertTrue(resolve(reportDir(), "index.html").exists());
4373
Assert.assertTrue(resolve(reportDir(), "2_11/src/main/scala/org/hello/World211.scala.html").exists());
4474
Assert.assertTrue(resolve(reportDir(), "2_12/src/main/scala/org/hello/World212.scala.html").exists());
75+
Assert.assertTrue(resolve(reportDir(), "2_13/src/main/scala/org/hello/World213.scala.html").exists());
4576
}
4677

4778
private void assert211ReportFilesExist() {

src/functionalTest/resources/projects/scala-multi-module-cross-version/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,4 @@ allprojects {
3232

3333
scoverage {
3434
minimumRate = 0.5
35-
}
36-
37-
project(":2_11").tasks.reportScoverage
38-
.mustRunAfter(project(":2_12").tasks.reportScoverage)
39-
.mustRunAfter(project(":2_13").tasks.reportScoverage)
35+
}

0 commit comments

Comments
 (0)