Skip to content

Commit 6c823ee

Browse files
committed
Support utest 0.7.4
Now to run asynchronous tests it's not needed the patched utest from the master branch. Using utest 0.7.4 and having the EventLoop runnable multiple times, it is run after every test.
1 parent c8832ef commit 6c823ee

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ lazy val commonSettings = Seq(
4444
"-Ywarn-unused-import"
4545
),
4646
Compile / doc / scalacOptions -= "-Xfatal-warnings",
47-
libraryDependencies += "com.lihaoyi" %%% "utest" % "0.7.5-SNAPSHOT" % Test,
47+
libraryDependencies += "com.lihaoyi" %%% "utest" % "0.7.4" % Test,
4848
testFrameworks += new TestFramework("utest.runner.Framework"),
4949
Test / nativeLinkStubs := true,
5050
publish / skip := true,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package scala.scalanative.loop
2+
3+
import utest._
4+
5+
abstract class LoopTestSuite extends TestSuite {
6+
override def utestAfterEach(path: Seq[String]): Unit = {
7+
EventLoop.run()
8+
}
9+
}

core/src/test/scala/scala/scalanative/loop/TimerTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import scala.concurrent.duration._
55
import scala.concurrent.ExecutionContext.Implicits.global
66
import scala.concurrent.Promise
77

8-
object TimerTests extends TestSuite {
8+
object TimerTests extends LoopTestSuite {
99
val tests = Tests {
1010
def now(): Duration = System.currentTimeMillis().millis
1111
val d = 200.millis

0 commit comments

Comments
 (0)