summaryrefslogtreecommitdiff
path: root/scalalib/test
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-02-02 21:48:35 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-02-02 21:48:35 -0800
commit80c8ad730132145fc33b790657b14669f282d5b0 (patch)
treefa9d39763756cc07a3e9524cf146186cb2979516 /scalalib/test
parent27273750636acbbff1b37cf53bba76684f0b96bb (diff)
downloadmill-80c8ad730132145fc33b790657b14669f282d5b0.tar.gz
mill-80c8ad730132145fc33b790657b14669f282d5b0.tar.bz2
mill-80c8ad730132145fc33b790657b14669f282d5b0.zip
- Rename `basePath` -> `millSourcePath`
- Make `T.worker`s not flush out their directories between instantiations
Diffstat (limited to 'scalalib/test')
-rw-r--r--scalalib/test/src/mill/scalalib/GenIdeaTests.scala34
-rw-r--r--scalalib/test/src/mill/scalalib/HelloWorldTests.scala24
2 files changed, 29 insertions, 29 deletions
diff --git a/scalalib/test/src/mill/scalalib/GenIdeaTests.scala b/scalalib/test/src/mill/scalalib/GenIdeaTests.scala
index 58992e4f..00d9f53e 100644
--- a/scalalib/test/src/mill/scalalib/GenIdeaTests.scala
+++ b/scalalib/test/src/mill/scalalib/GenIdeaTests.scala
@@ -8,13 +8,13 @@ import utest._
import mill.util.TestEvaluator.implicitDisover
object GenIdeaTests extends TestSuite {
- val basePath = pwd / 'target / 'workspace / "gen-idea"
- val outPath = basePath / 'out
- val workingSrcPath = basePath / 'src
+ val millSourcePath = pwd / 'target / 'workspace / "gen-idea"
+ val outPath = millSourcePath / 'out
+ val workingSrcPath = millSourcePath / 'src
trait HelloWorldModule extends scalalib.ScalaModule {
def scalaVersion = "2.12.4"
- def basePath = HelloWorldTests.workingSrcPath
+ def millSourcePath = HelloWorldTests.workingSrcPath
}
object HelloWorld extends TestUtil.BaseModule with HelloWorldModule
@@ -32,34 +32,34 @@ object GenIdeaTests extends TestSuite {
val layout = GenIdea.xmlFileLayout(helloWorldEvaluator.evaluator, HelloWorld, fetchMillModules = false)
for((relPath, xml) <- layout){
- write.over(basePath/ "generated"/ relPath, pp.format(xml))
+ write.over(millSourcePath/ "generated"/ relPath, pp.format(xml))
}
Seq(
"gen-idea/idea_modules/iml" ->
- basePath / "generated" / ".idea_modules" /".iml",
+ millSourcePath / "generated" / ".idea_modules" /".iml",
"gen-idea/idea_modules/root.iml" ->
- basePath / "generated" / ".idea_modules" /"root.iml",
+ millSourcePath / "generated" / ".idea_modules" /"root.iml",
"gen-idea/idea/libraries/scala-reflect_2.12.4_scala-reflect-2.12.4-sources.jar.xml" ->
- basePath / "generated" / ".idea" / "libraries" / "scala-reflect_2.12.4_scala-reflect-2.12.4-sources.jar.xml",
+ millSourcePath / "generated" / ".idea" / "libraries" / "scala-reflect_2.12.4_scala-reflect-2.12.4-sources.jar.xml",
"gen-idea/idea/libraries/scala-reflect_2.12.4_scala-reflect-2.12.4.jar.xml" ->
- basePath / "generated" / ".idea" / "libraries" / "scala-reflect_2.12.4_scala-reflect-2.12.4.jar.xml",
+ millSourcePath / "generated" / ".idea" / "libraries" / "scala-reflect_2.12.4_scala-reflect-2.12.4.jar.xml",
"gen-idea/idea/libraries/scala-library_2.12.4_scala-library-2.12.4.jar.xml" ->
- basePath / "generated" / ".idea" / "libraries" / "scala-library_2.12.4_scala-library-2.12.4.jar.xml",
+ millSourcePath / "generated" / ".idea" / "libraries" / "scala-library_2.12.4_scala-library-2.12.4.jar.xml",
"gen-idea/idea/libraries/modules_scala-xml_2.12_1.0.6_scala-xml_2.12-1.0.6.jar.xml" ->
- basePath / "generated" / ".idea" / "libraries" / "modules_scala-xml_2.12_1.0.6_scala-xml_2.12-1.0.6.jar.xml",
+ millSourcePath / "generated" / ".idea" / "libraries" / "modules_scala-xml_2.12_1.0.6_scala-xml_2.12-1.0.6.jar.xml",
"gen-idea/idea/libraries/modules_scala-xml_2.12_1.0.6_scala-xml_2.12-1.0.6-sources.jar.xml" ->
- basePath / "generated" / ".idea" / "libraries" / "modules_scala-xml_2.12_1.0.6_scala-xml_2.12-1.0.6-sources.jar.xml",
+ millSourcePath / "generated" / ".idea" / "libraries" / "modules_scala-xml_2.12_1.0.6_scala-xml_2.12-1.0.6-sources.jar.xml",
"gen-idea/idea/libraries/scala-compiler_2.12.4_scala-compiler-2.12.4-sources.jar.xml" ->
- basePath / "generated" / ".idea" / "libraries" / "scala-compiler_2.12.4_scala-compiler-2.12.4-sources.jar.xml",
+ millSourcePath / "generated" / ".idea" / "libraries" / "scala-compiler_2.12.4_scala-compiler-2.12.4-sources.jar.xml",
"gen-idea/idea/libraries/scala-library_2.12.4_scala-library-2.12.4-sources.jar.xml" ->
- basePath / "generated" / ".idea" / "libraries" / "scala-library_2.12.4_scala-library-2.12.4-sources.jar.xml",
+ millSourcePath / "generated" / ".idea" / "libraries" / "scala-library_2.12.4_scala-library-2.12.4-sources.jar.xml",
"gen-idea/idea/libraries/scala-compiler_2.12.4_scala-compiler-2.12.4.jar.xml" ->
- basePath / "generated" / ".idea" / "libraries" / "scala-compiler_2.12.4_scala-compiler-2.12.4.jar.xml",
+ millSourcePath / "generated" / ".idea" / "libraries" / "scala-compiler_2.12.4_scala-compiler-2.12.4.jar.xml",
"gen-idea/idea/modules.xml" ->
- basePath / "generated" / ".idea" / "modules.xml",
+ millSourcePath / "generated" / ".idea" / "modules.xml",
"gen-idea/idea/misc.xml" ->
- basePath / "generated" / ".idea" / "misc.xml"
+ millSourcePath / "generated" / ".idea" / "misc.xml"
).foreach { case (resource, generated) =>
val resourceString = scala.io.Source.fromResource(resource).getLines().mkString("\n")
val generatedString = normaliseLibraryPaths(read! generated)
diff --git a/scalalib/test/src/mill/scalalib/HelloWorldTests.scala b/scalalib/test/src/mill/scalalib/HelloWorldTests.scala
index 06d650c1..cecc9349 100644
--- a/scalalib/test/src/mill/scalalib/HelloWorldTests.scala
+++ b/scalalib/test/src/mill/scalalib/HelloWorldTests.scala
@@ -17,7 +17,7 @@ import scala.collection.JavaConverters._
object HelloWorldTests extends TestSuite {
trait HelloWorldModule extends scalalib.ScalaModule {
def scalaVersion = "2.12.4"
- def basePath = HelloWorldTests.workingSrcPath
+ def millSourcePath = HelloWorldTests.workingSrcPath
}
object HelloWorld extends TestUtil.BaseModule with HelloWorldModule
@@ -73,10 +73,10 @@ object HelloWorldTests extends TestSuite {
object HelloWorldScalaOverride extends TestUtil.BaseModule with HelloWorldModule {
override def scalaVersion: Target[String] = "2.11.11"
}
- val srcPath = pwd / 'scalalib / 'test / 'resources / "hello-world"
- val basePath = pwd / 'target / 'workspace / "hello-world"
- val workingSrcPath = basePath / 'src
- val outPath = basePath / 'out
+ val resourcePath = pwd / 'scalalib / 'test / 'resources / "hello-world"
+ val millSourcePath = pwd / 'target / 'workspace / "hello-world"
+ val workingSrcPath = millSourcePath / 'src
+ val outPath = millSourcePath / 'out
val mainObject = workingSrcPath / 'src / "Main.scala"
@@ -211,7 +211,7 @@ object HelloWorldTests extends TestSuite {
}
'runMain - {
'runMainObject - {
- val runResult = basePath / 'out / 'runMain / 'dest / "hello-mill"
+ val runResult = millSourcePath / 'out / 'runMain / 'dest / "hello-mill"
val Right((_, evalCount)) = helloWorldEvaluator(HelloWorld.runMain("Main", runResult.toString))
assert(evalCount > 0)
@@ -224,7 +224,7 @@ object HelloWorldTests extends TestSuite {
'runCross{
def cross(v: String) {
- val runResult = basePath / 'out / 'cross / v / 'runMain / 'dest / "hello-mill"
+ val runResult = millSourcePath / 'out / 'cross / v / 'runMain / 'dest / "hello-mill"
val Right((_, evalCount)) = helloWorldCrossEvaluator(
CrossHelloWorld.cross(v).runMain("Main", runResult.toString)
@@ -265,7 +265,7 @@ object HelloWorldTests extends TestSuite {
'forkRun - {
'runIfMainClassProvided - {
- val runResult = basePath / 'out / 'run / 'dest / "hello-mill"
+ val runResult = millSourcePath / 'out / 'run / 'dest / "hello-mill"
val Right((_, evalCount)) = helloWorldWithMainEvaluator(
HelloWorldWithMain.run(runResult.toString)
)
@@ -288,7 +288,7 @@ object HelloWorldTests extends TestSuite {
}
'run - {
'runIfMainClassProvided - {
- val runResult = basePath / 'out / 'run / 'dest / "hello-mill"
+ val runResult = millSourcePath / 'out / 'run / 'dest / "hello-mill"
val Right((_, evalCount)) = helloWorldWithMainEvaluator(
HelloWorldWithMain.runLocal(runResult.toString)
)
@@ -364,9 +364,9 @@ object HelloWorldTests extends TestSuite {
exists(result.path),
evalCount > 0
)
- val runResult = basePath / "hello-mill"
+ val runResult = millSourcePath / "hello-mill"
- %%("java", "-jar", result.path, runResult)(wd = basePath)
+ %%("java", "-jar", result.path, runResult)(wd = millSourcePath)
assert(
exists(runResult),
@@ -394,7 +394,7 @@ object HelloWorldTests extends TestSuite {
rm(outPath)
rm(workingSrcPath)
mkdir(outPath)
- cp(srcPath, workingSrcPath)
+ cp(resourcePath, workingSrcPath)
}
}