File tree 4 files changed +24
-7
lines changed
build/src/test/scala/scala/build/tests
integration/src/test/scala/scala/cli/integration
4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -596,7 +596,7 @@ abstract class BuildTests(server: Boolean) extends TestUtil.ScalaCliBuildSuite {
596
596
597
597
test(" cli dependency options shadowing using directives" ) {
598
598
val usingDependency = " org.scalameta::munit::1.0.0-M1"
599
- val cliDependency = " org.scalameta::munit::1.0.1 "
599
+ val cliDependency = " org.scalameta::munit::1.0.2 "
600
600
601
601
val inputs = TestInputs (
602
602
os.rel / " foo.scala" ->
Original file line number Diff line number Diff line change @@ -8,20 +8,30 @@ import java.util.concurrent.TimeUnit
8
8
import scala .concurrent .duration .FiniteDuration
9
9
10
10
object TestUtil {
11
+
11
12
abstract class ScalaCliBuildSuite extends munit.FunSuite {
13
+ extension (munitContext : BeforeEach | AfterEach ) {
14
+ def locationAbsolutePath : os.Path =
15
+ os.pwd / os.RelPath {
16
+ (munitContext match {
17
+ case beforeEach : BeforeEach => beforeEach.test
18
+ case afterEach : AfterEach => afterEach.test
19
+ }).location.path
20
+ }
21
+ }
12
22
override def munitTimeout = new FiniteDuration (120 , TimeUnit .SECONDS )
13
23
val testStartEndLogger = new Fixture [Unit ](" files" ) {
14
24
def apply (): Unit = ()
15
25
16
26
override def beforeEach (context : BeforeEach ): Unit = {
17
- val fileName = os. Path ( context.test.location.path) .baseName
27
+ val fileName = context.locationAbsolutePath .baseName
18
28
System .err.println(
19
29
s " >==== ${Console .CYAN }Running ' ${context.test.name}' from $fileName${Console .RESET }"
20
30
)
21
31
}
22
32
23
33
override def afterEach (context : AfterEach ): Unit = {
24
- val fileName = os. Path ( context.test.location.path) .baseName
34
+ val fileName = context.locationAbsolutePath .baseName
25
35
System .err.println(
26
36
s " X==== ${Console .CYAN }Finishing ' ${context.test.name}' from $fileName${Console .RESET }"
27
37
)
Original file line number Diff line number Diff line change @@ -5,18 +5,25 @@ import java.util.concurrent.TimeUnit
5
5
import scala .concurrent .duration .{Duration , FiniteDuration }
6
6
7
7
abstract class ScalaCliSuite extends munit.FunSuite {
8
- val testStartEndLogger = new Fixture [Unit ](" files" ) {
8
+ implicit class BeforeEachOpts (munitContext : BeforeEach ) {
9
+ def locationAbsolutePath : os.Path = os.pwd / os.RelPath (munitContext.test.location.path)
10
+ }
11
+
12
+ implicit class AfterEachOpts (munitContext : AfterEach ) {
13
+ def locationAbsolutePath : os.Path = os.pwd / os.RelPath (munitContext.test.location.path)
14
+ }
15
+ val testStartEndLogger : Fixture [Unit ] = new Fixture [Unit ](" files" ) {
9
16
def apply (): Unit = ()
10
17
11
18
override def beforeEach (context : BeforeEach ): Unit = {
12
- val fileName = os. Path ( context.test.location.path) .baseName
19
+ val fileName = context.locationAbsolutePath .baseName
13
20
System .err.println(
14
21
s " >==== ${Console .CYAN }Running ' ${context.test.name}' from $fileName${Console .RESET }"
15
22
)
16
23
}
17
24
18
25
override def afterEach (context : AfterEach ): Unit = {
19
- val fileName = os. Path ( context.test.location.path) .baseName
26
+ val fileName = context.locationAbsolutePath .baseName
20
27
System .err.println(
21
28
s " X==== ${Console .CYAN }Finishing ' ${context.test.name}' from $fileName${Console .RESET }"
22
29
)
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ object Deps {
184
184
def metaconfigTypesafe =
185
185
ivy " org.scalameta::metaconfig-typesafe-config:0.13.0 "
186
186
.exclude((" org.scala-lang" , " scala-compiler" ))
187
- def munit = ivy " org.scalameta::munit:1.0.1 "
187
+ def munit = ivy " org.scalameta::munit:1.0.2 "
188
188
def nativeTestRunner = ivy " org.scala-native::test-runner: ${Versions .scalaNative}"
189
189
def nativeTools = ivy " org.scala-native::tools: ${Versions .scalaNative}"
190
190
def osLib = ivy " com.lihaoyi::os-lib:0.10.6 "
You can’t perform that action at this time.
0 commit comments