summaryrefslogtreecommitdiff
path: root/core/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 /core/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 'core/test')
-rw-r--r--core/test/resources/examples/javac/build.sc4
-rw-r--r--core/test/src/mill/define/BasePathTests.scala14
-rw-r--r--core/test/src/mill/eval/ModuleTests.scala2
-rw-r--r--core/test/src/mill/util/TestEvaluator.scala14
4 files changed, 17 insertions, 17 deletions
diff --git a/core/test/resources/examples/javac/build.sc b/core/test/resources/examples/javac/build.sc
index 4a0882c6..8f250014 100644
--- a/core/test/resources/examples/javac/build.sc
+++ b/core/test/resources/examples/javac/build.sc
@@ -5,8 +5,8 @@ import mill.eval.PathRef
import mill.modules.Jvm
import mill.util.Loose
-def sourceRootPath = basePath / 'src
-def resourceRootPath = basePath / 'resources
+def sourceRootPath = millSourcePath / 'src
+def resourceRootPath = millSourcePath / 'resources
// sourceRoot -> allSources -> classFiles
// |
diff --git a/core/test/src/mill/define/BasePathTests.scala b/core/test/src/mill/define/BasePathTests.scala
index 62f84787..f7a1afa7 100644
--- a/core/test/src/mill/define/BasePathTests.scala
+++ b/core/test/src/mill/define/BasePathTests.scala
@@ -8,7 +8,7 @@ object BasePathTests extends TestSuite{
val testGraphs = new TestGraphs
val tests = Tests{
def check(m: Module, segments: String*) = {
- val remaining = m.basePath.relativeTo(pwd).segments.drop(1)
+ val remaining = m.millSourcePath.relativeTo(pwd).segments.drop(1)
assert(remaining == segments)
}
'singleton - {
@@ -47,18 +47,18 @@ object BasePathTests extends TestSuite{
}
'overriden - {
object overridenBasePath extends TestUtil.BaseModule {
- override def basePath = pwd / 'overridenBasePathRootValue
+ override def millSourcePath = pwd / 'overridenBasePathRootValue
object nested extends Module{
- override def basePath = super.basePath / 'overridenBasePathNested
+ override def millSourcePath = super.millSourcePath / 'overridenBasePathNested
object nested extends Module{
- override def basePath = super.basePath / 'overridenBasePathDoubleNested
+ override def millSourcePath = super.millSourcePath / 'overridenBasePathDoubleNested
}
}
}
assert(
- overridenBasePath.basePath == pwd / 'overridenBasePathRootValue,
- overridenBasePath.nested.basePath == pwd / 'overridenBasePathRootValue / 'nested / 'overridenBasePathNested,
- overridenBasePath.nested.nested.basePath == pwd / 'overridenBasePathRootValue / 'nested / 'overridenBasePathNested / 'nested / 'overridenBasePathDoubleNested
+ overridenBasePath.millSourcePath == pwd / 'overridenBasePathRootValue,
+ overridenBasePath.nested.millSourcePath == pwd / 'overridenBasePathRootValue / 'nested / 'overridenBasePathNested,
+ overridenBasePath.nested.nested.millSourcePath == pwd / 'overridenBasePathRootValue / 'nested / 'overridenBasePathNested / 'nested / 'overridenBasePathDoubleNested
)
}
diff --git a/core/test/src/mill/eval/ModuleTests.scala b/core/test/src/mill/eval/ModuleTests.scala
index 110e8c79..56c1a47b 100644
--- a/core/test/src/mill/eval/ModuleTests.scala
+++ b/core/test/src/mill/eval/ModuleTests.scala
@@ -26,7 +26,7 @@ object ModuleTests extends TestSuite{
)
val Right((30, 1)) = check.apply(Build.z)
- val base = check.evaluator.workspacePath
+ val base = check.evaluator.outPath
assert(
read(base / 'z / "meta.json").contains("30"),
read(base / 'mill / 'eval / 'ModuleTests / 'ExternalModule / 'x / "meta.json").contains("13"),
diff --git a/core/test/src/mill/util/TestEvaluator.scala b/core/test/src/mill/util/TestEvaluator.scala
index 3b34e27d..26577f3e 100644
--- a/core/test/src/mill/util/TestEvaluator.scala
+++ b/core/test/src/mill/util/TestEvaluator.scala
@@ -10,16 +10,16 @@ import utest.assert
import language.experimental.macros
object TestEvaluator{
implicit def implicitDisover[T]: Discover[T] = macro applyImpl[T]
- val externalBasePath = pwd / 'target / 'external
+ val externalOutPath = pwd / 'target / 'external
}
class TestEvaluator[T <: TestUtil.TestBuild](module: T,
workspacePath: Path,
- basePath: Path)
+ millSourcePath: Path)
(implicit discover: Discover[T]){
- val evaluator = new Evaluator(
- workspacePath, basePath, TestEvaluator.externalBasePath, module, discover, DummyLogger
- )
-// val evaluator = new Evaluator(workspacePath, basePath, module, discover, new PrintLogger(true, ammonite.util.Colors.Default, System.out, System.out, System.err))
+ val logger = DummyLogger
+// val logger = new PrintLogger(true, ammonite.util.Colors.Default, System.out, System.out, System.err)
+ val evaluator = new Evaluator(workspacePath, millSourcePath, TestEvaluator.externalOutPath, module, discover, logger)
+
def apply[T](t: Task[T]): Either[Result.Failing, (T, Int)] = {
val evaluated = evaluator.evaluate(Agg(t))
@@ -31,7 +31,7 @@ class TestEvaluator[T <: TestUtil.TestBuild](module: T,
case t: Target[_]
if module.millInternal.targets.contains(t)
&& !t.isInstanceOf[Input[_]] => t
- case t: mill.define.Command[_] => t
+ case t: mill.define.Command[_] => t
}.size
))
} else {