Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

remove ScalaCheck support #72

Merged
merged 1 commit into from
Jan 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ definedTests in Test += (
and files (including java sources) in that directory are compiled in order by looking
at `_$N` suffixes before the file's extension and compiling them grouped by $N, in ascending order.
- jars in `test/files/lib` are expected to be on the classpath and may be used by tests
- certain kinds of tests (scalacheck/instrumented/specialized) add additional jars to the classpath
- certain kinds of tests (instrumented/specialized) add additional jars to the classpath

## System properties available to tests:

Expand Down
5 changes: 0 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ scalaXmlVersion := {
if (scalaVersion.value.startsWith("2.11.")) "1.0.4" else "1.0.6"
}

scalaCheckVersion := "1.11.6"

// TODO: eliminate "-deprecation:false" for nightlies,
// included by default because we don't want to break scala/scala pr validation
scalacOptions ++=
Expand All @@ -43,9 +41,6 @@ libraryDependencies += "com.googlecode.java-diff-utils" % "diffutils" % "1.

libraryDependencies += "org.scala-sbt" % "test-interface" % "1.0"

// to run scalacheck tests, depend on scalacheck separately
libraryDependencies += "org.scalacheck" %% "scalacheck" % scalaCheckVersion.value % "provided"

// mark all scala dependencies as provided which means one has to explicitly provide them when depending on partest
// this allows for easy testing of modules (like scala-xml) that provide tested classes themselves and shouldn't
// pull in an older version of itself
Expand Down
1 change: 0 additions & 1 deletion project/keys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ object VersionKeys {

// To facilitate scripted build of all modules (while we're working on getting dbuild up and running)
val scalaXmlVersion = settingKey[String]("Version to use for the scala-xml dependency.")
val scalaCheckVersion = settingKey[String]("Version to use for the scalacheck dependency.")
}
2 changes: 1 addition & 1 deletion src/main/scala/scala/tools/partest/TestKinds.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package partest
import nest.PathSettings.srcDir

object TestKinds {
val standardKinds = ("pos neg run jvm res scalacheck scalap specialized instrumented presentation" split "\\s+").toList
val standardKinds = ("pos neg run jvm res scalap specialized instrumented presentation" split "\\s+").toList

def denotesTestFile(p: Path) = p.isFile && p.hasExtension("scala", "res", "xml")
def denotesTestDir(p: Path) = kindOf(p) match {
Expand Down
46 changes: 0 additions & 46 deletions src/main/scala/scala/tools/partest/nest/Runner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -573,51 +573,6 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
case _ => Array.empty[String]
}

def runScalacheckTest() = runTestCommon {
nestUI.verbose(f"compilation of $testFile succeeded%n")

val logWriter = new PrintStream(new FileOutputStream(logFile), true)

def runInFramework(): Boolean = {
import org.scalatools.testing._
// getClass.getClassLoader.instantiate[Framework]("org.scalacheck.ScalaCheckFramework")
val f: Framework = new org.scalacheck.ScalaCheckFramework
val logger = new Logger {
def ansiCodesSupported = false //params.env.isSet("colors")
def error(msg: String) = logWriter println msg
def warn(msg: String) = logWriter println msg
def info(msg: String) = logWriter println msg
def debug(msg: String) = logWriter println msg
def trace(t: Throwable) = t printStackTrace logWriter
}
var bad = 0
val handler = new EventHandler {
// testName, description, result, error
// Result = Success, Failure, Error, Skipped
def handle(event: Event): Unit = event.result match {
case Result.Success =>
//case Result.Skipped => // an exhausted test is skipped, therefore bad
case _ => bad += 1
}
}
val loggers = Array(logger)
val loader = ScalaClassLoader.fromURLs(List(outDir.toURI.toURL), getClass.getClassLoader)
val r = f.testRunner(loader, loggers).asInstanceOf[Runner2] // cast to interface with the fingerprint we want
val claas = "Test"
val fingerprint = f.tests collectFirst { case x: SubclassFingerprint if x.isModule => x }
val args = toolArgs("scalacheck")
nestUI.vlog(s"Run $testFile with args $args")
// set the context class loader for scaladoc/scalacheck tests (FIX ME)
ScalaClassLoader(fileManager.testClassLoader).asContext {
r.run(claas, fingerprint.get, handler, args.toArray) // synchronous?
}
val ok = (bad == 0)
if (!ok) _transcript append logFile.fileContents
ok
}
try nextTestActionExpectTrue("ScalaCheck test failed", runInFramework()) finally logWriter.close()
}

def runResidentTest() = {
// simulate resident compiler loop
val prompt = "\nnsc> "
Expand Down Expand Up @@ -693,7 +648,6 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
else kind match {
case "pos" => runTestCommon(true)
case "ant" => runAntTest()
case "scalacheck" => runScalacheckTest()
case "res" => runResidentTest()
case "scalap" => runScalapTest()
case "script" => runScriptTest()
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/scala/tools/partest/nest/RunnerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ trait RunnerSpec extends Spec with Meta.StdOpts with Interpolation {
val optAnt = "ant" / "run Ant tests" --?
val optScalap = "scalap" / "run scalap tests" --?
val optSpecialized = "specialized" / "run specialization tests" --?
val optScalacheck = "scalacheck" / "run ScalaCheck tests" --?
val optInstrumented = "instrumented" / "run instrumented tests" --?
val optPresentation = "presentation" / "run presentation compiler tests" --?

Expand Down