forked from scoverage/gradle-scoverage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScalaVersionTest.java
35 lines (27 loc) · 1.28 KB
/
ScalaVersionTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package org.scoverage.crossversion;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.scoverage.ScoverageFunctionalTest;
import org.scoverage.ScoveragePlugin;
import java.io.File;
/**
* This abstract class is used to test each scala version in an individual class.
* It is crucial that each test will be separated into its own class,
* as this is the only way to run these tests in separate JVM processes (via `forkEvery` gradle configuration).
*/
public abstract class ScalaVersionTest extends ScoverageFunctionalTest {
private final String scalaVersion;
public ScalaVersionTest(String scalaVersion) {
super("scala-multi-module-cross-version");
this.scalaVersion = scalaVersion;
}
@Test
public void report() throws Exception {
AssertableBuildResult result = run("clean", ":" + scalaVersion + ":" + ScoveragePlugin.getREPORT_NAME());
result.assertTaskSucceeded(scalaVersion + ":" + ScoveragePlugin.getREPORT_NAME());
File reportDir = reportDir(projectDir().toPath().resolve(scalaVersion).toFile());
Assert.assertTrue(resolve(reportDir, "index.html").exists());
Assert.assertTrue(resolve(reportDir, "src/main/scala/org/hello/World" + scalaVersion + ".scala.html").exists());
}
}