@@ -3,30 +3,24 @@ package vulpix
3
3
4
4
import java .io .{File => JFile }
5
5
import org .junit .Assert ._
6
- import org .junit .Test
6
+ import org .junit .{ Test , AfterClass }
7
7
8
8
import scala .concurrent .duration ._
9
9
import scala .util .control .NonFatal
10
10
11
11
/** Unit tests for the Vulpix test suite */
12
- class VulpixUnitTests extends ParallelTesting {
12
+ class VulpixUnitTests {
13
+ import VulpixUnitTests ._
13
14
import TestConfiguration ._
14
15
15
16
implicit val _: SummaryReporting = new NoSummaryReport
16
17
17
18
implicit def testGroup : TestGroup = TestGroup (" VulpixTests" )
18
19
19
- def maxDuration = 3 .seconds
20
- def numberOfSlaves = 5
21
- def safeMode = sys.env.get(" SAFEMODE" ).isDefined
22
- def isInteractive = ! sys.env.contains(" DRONE" )
23
- def testFilter = None
24
- def updateCheckFiles : Boolean = false
25
-
26
20
// To fail with something else than an AssertionError
27
21
def fail (): Unit = throw new Exception (" didn't fail properly" )
28
22
29
- @ Test def missingFile : Unit = if ( ! scala.util. Properties .isWin)
23
+ @ Test def missingFile : Unit =
30
24
try {
31
25
compileFile(" tests/vulpix-tests/unit/i-dont-exist.scala" , defaultOptions).expectFailure.checkExpectedErrors()
32
26
fail()
@@ -64,7 +58,7 @@ class VulpixUnitTests extends ParallelTesting {
64
58
@ Test def runDiffOutput1 : Unit =
65
59
compileFile(" tests/vulpix-tests/unit/runDiffOutput1.scala" , defaultOptions).expectFailure.checkRuns()
66
60
67
- @ Test def runStackOverflow : Unit = if ( ! scala.util. Properties .isWin)
61
+ @ Test def runStackOverflow : Unit =
68
62
compileFile(" tests/vulpix-tests/unit/stackOverflow.scala" , defaultOptions).expectFailure.checkRuns()
69
63
70
64
@ Test def runOutRedirects : Unit =
@@ -82,15 +76,15 @@ class VulpixUnitTests extends ParallelTesting {
82
76
@ Test def deadlock : Unit =
83
77
compileFile(" tests/vulpix-tests/unit/deadlock.scala" , defaultOptions).expectFailure.checkRuns()
84
78
85
- @ Test def badJava : Unit = if ( ! scala.util. Properties .isWin)
79
+ @ Test def badJava : Unit =
86
80
try {
87
81
compileFile(" tests/vulpix-tests/unit/BadJava.java" , defaultOptions).suppressAllOutput.checkCompile()
88
82
fail()
89
83
} catch {
90
84
case ae : AssertionError => assertTrue(ae.getMessage.contains(" java compilation failed" ))
91
85
}
92
86
93
- @ Test def runTimeout : Unit = if ( ! scala.util. Properties .isWin) {
87
+ @ Test def runTimeout : Unit = {
94
88
val fileName = s " tests/vulpix-tests/unit/timeout.scala "
95
89
try {
96
90
compileFile(fileName, defaultOptions).checkRuns()
@@ -103,3 +97,16 @@ class VulpixUnitTests extends ParallelTesting {
103
97
}
104
98
}
105
99
}
100
+
101
+
102
+ object VulpixUnitTests extends ParallelTesting {
103
+ def maxDuration = 3 .seconds
104
+ def numberOfSlaves = 5
105
+ def safeMode = sys.env.get(" SAFEMODE" ).isDefined
106
+ def isInteractive = ! sys.env.contains(" DRONE" )
107
+ def testFilter = None
108
+ def updateCheckFiles : Boolean = false
109
+
110
+ @ AfterClass
111
+ def tearDown () = this .cleanup()
112
+ }
0 commit comments