diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-02 21:48:35 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-02 21:48:35 -0800 |
commit | 80c8ad730132145fc33b790657b14669f282d5b0 (patch) | |
tree | fa9d39763756cc07a3e9524cf146186cb2979516 /core/test/src | |
parent | 27273750636acbbff1b37cf53bba76684f0b96bb (diff) | |
download | mill-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/src')
-rw-r--r-- | core/test/src/mill/define/BasePathTests.scala | 14 | ||||
-rw-r--r-- | core/test/src/mill/eval/ModuleTests.scala | 2 | ||||
-rw-r--r-- | core/test/src/mill/util/TestEvaluator.scala | 14 |
3 files changed, 15 insertions, 15 deletions
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 { |