Skip to content

Commit

Permalink
Merge pull request #96 from gkossakowski/scripted-tests
Browse files Browse the repository at this point in the history
Scripted tests improvements
  • Loading branch information
gkossakowski committed Apr 26, 2016
2 parents 088a577 + ffe3b90 commit f3a4608
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ final class IncHandler(directory: File, scriptedLog: Logger) extends BridgeProvi
override def apply(className: String): Boolean = x(className)
}
}
val classesDir = directory / "target" / "classes"
val targetDir = directory / "target"
val classesDir = targetDir / "classes"
val scalaSourceDirectory = directory / "src" / "main" / "scala"
val javaSourceDirectory = directory / "src" / "main" / "java"
def scalaSources: List[File] =
Expand Down Expand Up @@ -189,7 +190,11 @@ final class IncHandler(directory: File, scriptedLog: Logger) extends BridgeProvi
case _ => compiler.emptyPreviousResult
}
val analysisMap = f1((f: File) => prev.analysis)
val incOptions = loadIncOptions(directory / "incOptions.properties")
val transactional: xsbti.Maybe[xsbti.compile.ClassfileManagerType] =
Maybe.just(new xsbti.compile.TransactionalManagerType(targetDir / "classes.bak", sbt.util.Logger.Null))
// you can't specify class file manager in the properties files so let's overwrite it to be the transactional
// one (that's the default for sbt)
val incOptions = loadIncOptions(directory / "incOptions.properties").withClassfileManagerType(transactional)
val reporter = new LoggerReporter(maxErrors, scriptedLog, identity)
val extra = Array(t2(("key", "value")))
val setup = compiler.setup(analysisMap, dc, skip = false, cacheFile, CompilerCache.fresh, incOptions, reporter, extra)
Expand Down
11 changes: 0 additions & 11 deletions zinc/src/sbt-test/source-dependencies/sealed/pending

This file was deleted.

9 changes: 9 additions & 0 deletions zinc/src/sbt-test/source-dependencies/sealed/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
> compile

# have new class E extend A
$ copy-file changes/A.scala A.scala

# D.scala needs recompiling because the pattern match in D
# is no longer exhaustive, which emits a warning
> checkRecompilations 1 A B C E
> checkRecompilations 2 D

0 comments on commit f3a4608

Please sign in to comment.