mirror of https://github.com/sbt/sbt.git
fix tests, discovery
updated compile tests for new minimal AnalysisCallback moved discovery to discovery/ subproject and updated for new approach fixed discovery to only find public methods when searching for annotated definitions extracting inherited definitions unimplemented in api/, so some discovery tests fail moved discovery classes from sbt.inc package to sbt.compile
This commit is contained in:
parent
5a71431031
commit
0425532275
|
|
@ -1,34 +1,23 @@
|
|||
package xsbti
|
||||
|
||||
import java.io.File
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
import java.io.File
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
|
||||
class TestCallback(val superclassNames: Array[String], val annotationNames: Array[String]) extends AnalysisCallback
|
||||
class TestCallback extends AnalysisCallback
|
||||
{
|
||||
val invalidSuperclasses = new ArrayBuffer[String]
|
||||
val beganSources = new ArrayBuffer[File]
|
||||
val endedSources = new ArrayBuffer[File]
|
||||
val foundSubclasses = new ArrayBuffer[(File, String, String, Boolean)]
|
||||
val foundAnnotated = new ArrayBuffer[(File, String, String, Boolean)]
|
||||
val sourceDependencies = new ArrayBuffer[(File, File)]
|
||||
val jarDependencies = new ArrayBuffer[(File, File)]
|
||||
val classDependencies = new ArrayBuffer[(File, File)]
|
||||
val productDependencies = new ArrayBuffer[(File, File)]
|
||||
val binaryDependencies = new ArrayBuffer[(File, String, File)]
|
||||
val products = new ArrayBuffer[(File, File)]
|
||||
val applications = new ArrayBuffer[(File, String)]
|
||||
val apis = new ArrayBuffer[(File, xsbti.api.Source)]
|
||||
|
||||
def superclassNotFound(superclassName: String) { invalidSuperclasses += superclassName }
|
||||
def beginSource(source: File) { beganSources += source }
|
||||
def foundSubclass(source: File, subclassName: String, superclassName: String, isModule: Boolean): Unit =
|
||||
foundSubclasses += ((source, subclassName, superclassName, isModule))
|
||||
def foundAnnotated(source: File, className: String, annotationName: String, isModule: Boolean): Unit =
|
||||
foundAnnotated += ((source, className, annotationName, isModule))
|
||||
|
||||
def sourceDependency(dependsOn: File, source: File) { sourceDependencies += ((dependsOn, source)) }
|
||||
def jarDependency(jar: File, source: File) { jarDependencies += ((jar, source)) }
|
||||
def classDependency(clazz: File, source: File) { classDependencies += ((clazz, source)) }
|
||||
def productDependency(clazz: File, source: File) { productDependencies += ((clazz, source)) }
|
||||
def binaryDependency(binary: File, name: String, source: File) { binaryDependencies += ((binary, name, source)) }
|
||||
def generatedClass(source: File, module: File) { products += ((source, module)) }
|
||||
def endSource(source: File) { endedSources += source }
|
||||
def foundApplication(source: File, className: String) { applications += ((source, className)) }
|
||||
def api(source: File, sourceAPI: xsbti.api.Source) = ()
|
||||
|
||||
def api(source: File, sourceAPI: xsbti.api.Source) { apis += ((source, sourceAPI)) }
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package sbt
|
||||
|
||||
object TestLogger
|
||||
{
|
||||
def apply[T](f: Logger => T): T =
|
||||
{
|
||||
val log = new BufferedLogger(ConsoleLogger())
|
||||
log.setLevel(Level.Debug)
|
||||
log.bufferQuietly(f(log))
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue