@@ -2,22 +2,41 @@ package dotty
2
2
package tools
3
3
package dotc
4
4
5
- import org .junit .{ Test => JUnitTest , BeforeClass , AfterClass }
5
+ import org .junit .{ Test , BeforeClass , AfterClass }
6
6
import org .junit .experimental .categories .Category
7
7
8
8
import scala .concurrent .duration ._
9
9
import reporting .TestReporter
10
10
import vulpix ._
11
11
12
12
@ Category (Array (classOf [ScalaJSCompilationTests ]))
13
- class ScalaJSCompilationTests extends ParallelTesting {
13
+ class ScalaJSCompilationTests {
14
14
import ParallelTesting ._
15
15
import TestConfiguration ._
16
16
import ScalaJSCompilationTests ._
17
17
import CompilationTest .aggregateTests
18
18
19
- // Test suite configuration --------------------------------------------------
19
+ // Negative tests ------------------------------------------------------------
20
+
21
+ @ Test def negScalaJS : Unit = {
22
+ implicit val testGroup : TestGroup = TestGroup (" negScalaJS" )
23
+ aggregateTests(
24
+ compileFilesInDir(" tests/neg-scalajs" , scalaJSOptions),
25
+ ).checkExpectedErrors()
26
+ }
27
+
28
+ @ Test def runScalaJS : Unit = {
29
+ implicit val testGroup : TestGroup = TestGroup (" runScalaJS" )
30
+ aggregateTests(
31
+ compileFilesInDir(" tests/run" , scalaJSOptions),
32
+ ).checkRuns()
33
+ }
34
+ }
35
+
36
+ object ScalaJSCompilationTests extends ParallelTesting {
37
+ implicit val summaryReport : SummaryReporting = new SummaryReport
20
38
39
+ // Test suite configuration --------------------------------------------------
21
40
def maxDuration = 60 .seconds
22
41
def numberOfSlaves = 5
23
42
def safeMode = Properties .testsSafeMode
@@ -26,14 +45,9 @@ class ScalaJSCompilationTests extends ParallelTesting {
26
45
def updateCheckFiles : Boolean = Properties .testsUpdateCheckfile
27
46
def failedTests = TestReporter .lastRunFailedTests
28
47
29
- // Negative tests ------------------------------------------------------------
30
-
31
- @ JUnitTest def negScalaJS : Unit = {
32
- implicit val testGroup : TestGroup = TestGroup (" negScalaJS" )
33
- aggregateTests(
34
- compileFilesInDir(" tests/neg-scalajs" , scalaJSOptions),
35
- ).checkExpectedErrors()
36
- }
48
+ @ AfterClass def tearDown (): Unit =
49
+ cleanup()
50
+ summaryReport.echoSummary()
37
51
38
52
// Run tests -----------------------------------------------------------------
39
53
@@ -57,16 +71,4 @@ class ScalaJSCompilationTests extends ParallelTesting {
57
71
t.printStackTrace(new java.io.PrintWriter (writer))
58
72
Failure (writer.toString())
59
73
end runMain
60
-
61
- @ JUnitTest def runScalaJS : Unit = {
62
- implicit val testGroup : TestGroup = TestGroup (" runScalaJS" )
63
- aggregateTests(
64
- compileFilesInDir(" tests/run" , scalaJSOptions),
65
- ).checkRuns()
66
- }
67
- }
68
-
69
- object ScalaJSCompilationTests {
70
- implicit val summaryReport : SummaryReporting = new SummaryReport
71
- @ AfterClass def cleanup (): Unit = summaryReport.echoSummary()
72
74
}
0 commit comments