Skip to content

Commit 0eeeb59

Browse files
committed
Adding class to main in 'a-tests' breaks reports
1 parent ca7abc8 commit 0eeeb59

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/test/groovy/org/scoverage/SeparateTestsAcceptanceTest.groovy

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class SeparateTestsAcceptanceTest extends AcceptanceTestUtils {
2323
def testsIndexHtml = new File(reportDir(testsSubprojectDir), 'index.html')
2424
checkFile('an index HTML file', testsIndexHtml, false)
2525

26+
// ... and 'Hello.scala' is present there ...
27+
def helloHtml = new File(reportDir(subprojectDir), 'src/main/scala/hello/Hello.scala.html')
28+
checkFile('Hello.scala html file', helloHtml, true)
29+
2630
// ... and both statement and branch coverage is 100%
2731
def branchCoverage = coverage(reportDir(subprojectDir), CoverageType.Branch)
2832
def statementCoverage = coverage(reportDir(subprojectDir), CoverageType.Statement)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package hello
2+
3+
class BaseTest {
4+
def beforeTest() = {
5+
println("Running test!")
6+
}
7+
}

src/test/separate-tests/a-tests/src/test/scala/hello/HelloTest.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package hello
33
import org.junit.Test
44
import org.junit.Assert.assertEquals
55

6-
class HelloTest {
6+
class HelloTest extends BaseTest {
77

88
@Test def testText() {
9+
beforeTest()
910
assertEquals("Hello World", new Hello().text)
1011
}
1112

0 commit comments

Comments
 (0)