Skip to content

Commit

Permalink
Attempt to fix forked test runs on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lefou committed Apr 8, 2022
1 parent db303dd commit 1e6ebed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,9 @@ object integration extends MillScalaModule {
}
override def forkArgs = testArgs()

def testMill: Target[PathRef] = T {
PathRef(installLocalTask(binFile = T.task((T.dest / "mill").toString()))())
def testMill: Target[PathRef] = {
val name = if (scala.util.Properties.isWin) "mill.bat" else "mill"
T { PathRef(installLocalTask(binFile = T.task((T.dest / name).toString()))()) }
}

trait Tests extends super.Tests {
Expand Down
3 changes: 2 additions & 1 deletion integration/local/src/DocAnnotationsTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class DocAnnotationsTests(fork: Boolean) extends ScriptTestSuite(fork) {
val tests = Tests {
initWorkspace()
"test" - {
assert(eval("inspect", "core.test.ivyDeps"))
val res = eval("inspect", "core.test.ivyDeps")
assert(res == true)
val inheritedIvyDeps = ujson.read(meta("inspect"))("value").str
assert(
inheritedIvyDeps.contains("core.test.ivyDeps"),
Expand Down
9 changes: 6 additions & 3 deletions integration/local/src/HygieneTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ import utest._

class HygieneTests(fork: Boolean) extends ScriptTestSuite(fork) {
override def workspaceSlug: String = "hygiene"
override def workspacePath: os.Path = os.Path(sys.props.getOrElse("MILL_WORKSPACE_PATH", ???)) / getClass().getName()
override def scriptSourcePath: os.Path = os.pwd / "integration" / "local" / "resources" / workspaceSlug
override def workspacePath: os.Path =
os.Path(sys.props.getOrElse("MILL_WORKSPACE_PATH", ???)) / getClass().getName()
override def scriptSourcePath: os.Path =
os.pwd / "integration" / "local" / "resources" / workspaceSlug

val tests = Tests {
initWorkspace()

test {
assert(eval("scala.foo"))
val res = eval("scala.foo")
assert(res == true)
val output = meta("scala.foo")
assert(output.contains("\"fooValue\""))
}
Expand Down

0 comments on commit 1e6ebed

Please sign in to comment.