Reorganize test structure for `mainSettings`

This commit is contained in:
jvican 2017-05-24 11:27:04 +02:00
parent 2692bec21d
commit 5b7180cfa7
No known key found for this signature in database
GPG Key ID: 42DAFA0F112E8050
4 changed files with 9 additions and 6 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
target/
__pycache__
toolbox.classpath

View File

@ -285,7 +285,9 @@ lazy val generateToolboxClasspath = Def.task {
resourceDir.mkdir() // In case it doesn't exist
val toolboxTestClasspath = resourceDir / "toolbox.classpath"
IO.write(toolboxTestClasspath, classpath)
List(toolboxTestClasspath.getAbsoluteFile)
val result = List(toolboxTestClasspath.getAbsoluteFile)
streams.value.log.success("Wrote the classpath for the macro neg test suite.")
result
}
// Fixes scope=Scope for Setting (core defined in collectionProj) to define the settings system used in build definitions

View File

@ -8,7 +8,6 @@ package sbt.std
import scala.reflect._
object TestUtil {
import scala.language.postfixOps
import tools.reflect.{ ToolBox, ToolBoxError }
def intercept[T <: Throwable: ClassTag](test: => Any): T = {
@ -42,7 +41,7 @@ object TestUtil {
def expectError(errorSnippet: String,
compileOptions: String = "-Xmacro-settings:debug-spores",
baseCompileOptions: String = s"-cp $toolboxClasspath")(code: String) {
baseCompileOptions: String = s"-cp $toolboxClasspath")(code: String): Unit = {
val errorMessage = intercept[ToolBoxError] {
eval(code, s"$compileOptions $baseCompileOptions")
}.getMessage

View File

@ -1,8 +1,8 @@
package sbt
package std
package sbt.std
import sbt.internal.util.complete
import sbt.internal.util.complete.DefaultParsers
import sbt.{Def, InputTask, Task}
/*object UseTask
{
@ -20,7 +20,8 @@ import sbt.internal.util.complete.DefaultParsers
}*/
object Assign {
import java.io.File
import Def.{ Initialize, inputKey, macroValueT, parserToInput, settingKey, taskKey }
import Def.{Initialize, inputKey, macroValueT, parserToInput, settingKey, taskKey}
// import UseTask.{x,y,z,a,set,plain}
val ak = taskKey[Int]("a")