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

Commit d68f47a

Browse files
authored
Merge pull request #72 from SethTisue/no-scalacheck
remove ScalaCheck support
2 parents 0ec12a2 + 181c1dc commit d68f47a

File tree

6 files changed

+2
-55
lines changed

6 files changed

+2
-55
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ definedTests in Test += (
7575
and files (including java sources) in that directory are compiled in order by looking
7676
at `_$N` suffixes before the file's extension and compiling them grouped by $N, in ascending order.
7777
- jars in `test/files/lib` are expected to be on the classpath and may be used by tests
78-
- certain kinds of tests (scalacheck/instrumented/specialized) add additional jars to the classpath
78+
- certain kinds of tests (instrumented/specialized) add additional jars to the classpath
7979

8080
## System properties available to tests:
8181

build.sbt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ scalaXmlVersion := {
2222
if (scalaVersion.value.startsWith("2.11.")) "1.0.4" else "1.0.6"
2323
}
2424

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

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

46-
// to run scalacheck tests, depend on scalacheck separately
47-
libraryDependencies += "org.scalacheck" %% "scalacheck" % scalaCheckVersion.value % "provided"
48-
4944
// mark all scala dependencies as provided which means one has to explicitly provide them when depending on partest
5045
// this allows for easy testing of modules (like scala-xml) that provide tested classes themselves and shouldn't
5146
// pull in an older version of itself

project/keys.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ object VersionKeys {
33

44
// To facilitate scripted build of all modules (while we're working on getting dbuild up and running)
55
val scalaXmlVersion = settingKey[String]("Version to use for the scala-xml dependency.")
6-
val scalaCheckVersion = settingKey[String]("Version to use for the scalacheck dependency.")
76
}

src/main/scala/scala/tools/partest/TestKinds.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package partest
44
import nest.PathSettings.srcDir
55

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

99
def denotesTestFile(p: Path) = p.isFile && p.hasExtension("scala", "res", "xml")
1010
def denotesTestDir(p: Path) = kindOf(p) match {

src/main/scala/scala/tools/partest/nest/Runner.scala

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -573,51 +573,6 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
573573
case _ => Array.empty[String]
574574
}
575575

576-
def runScalacheckTest() = runTestCommon {
577-
nestUI.verbose(f"compilation of $testFile succeeded%n")
578-
579-
val logWriter = new PrintStream(new FileOutputStream(logFile), true)
580-
581-
def runInFramework(): Boolean = {
582-
import org.scalatools.testing._
583-
// getClass.getClassLoader.instantiate[Framework]("org.scalacheck.ScalaCheckFramework")
584-
val f: Framework = new org.scalacheck.ScalaCheckFramework
585-
val logger = new Logger {
586-
def ansiCodesSupported = false //params.env.isSet("colors")
587-
def error(msg: String) = logWriter println msg
588-
def warn(msg: String) = logWriter println msg
589-
def info(msg: String) = logWriter println msg
590-
def debug(msg: String) = logWriter println msg
591-
def trace(t: Throwable) = t printStackTrace logWriter
592-
}
593-
var bad = 0
594-
val handler = new EventHandler {
595-
// testName, description, result, error
596-
// Result = Success, Failure, Error, Skipped
597-
def handle(event: Event): Unit = event.result match {
598-
case Result.Success =>
599-
//case Result.Skipped => // an exhausted test is skipped, therefore bad
600-
case _ => bad += 1
601-
}
602-
}
603-
val loggers = Array(logger)
604-
val loader = ScalaClassLoader.fromURLs(List(outDir.toURI.toURL), getClass.getClassLoader)
605-
val r = f.testRunner(loader, loggers).asInstanceOf[Runner2] // cast to interface with the fingerprint we want
606-
val claas = "Test"
607-
val fingerprint = f.tests collectFirst { case x: SubclassFingerprint if x.isModule => x }
608-
val args = toolArgs("scalacheck")
609-
nestUI.vlog(s"Run $testFile with args $args")
610-
// set the context class loader for scaladoc/scalacheck tests (FIX ME)
611-
ScalaClassLoader(fileManager.testClassLoader).asContext {
612-
r.run(claas, fingerprint.get, handler, args.toArray) // synchronous?
613-
}
614-
val ok = (bad == 0)
615-
if (!ok) _transcript append logFile.fileContents
616-
ok
617-
}
618-
try nextTestActionExpectTrue("ScalaCheck test failed", runInFramework()) finally logWriter.close()
619-
}
620-
621576
def runResidentTest() = {
622577
// simulate resident compiler loop
623578
val prompt = "\nnsc> "
@@ -693,7 +648,6 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
693648
else kind match {
694649
case "pos" => runTestCommon(true)
695650
case "ant" => runAntTest()
696-
case "scalacheck" => runScalacheckTest()
697651
case "res" => runResidentTest()
698652
case "scalap" => runScalapTest()
699653
case "script" => runScriptTest()

src/main/scala/scala/tools/partest/nest/RunnerSpec.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ trait RunnerSpec extends Spec with Meta.StdOpts with Interpolation {
2020
val optAnt = "ant" / "run Ant tests" --?
2121
val optScalap = "scalap" / "run scalap tests" --?
2222
val optSpecialized = "specialized" / "run specialization tests" --?
23-
val optScalacheck = "scalacheck" / "run ScalaCheck tests" --?
2423
val optInstrumented = "instrumented" / "run instrumented tests" --?
2524
val optPresentation = "presentation" / "run presentation compiler tests" --?
2625

0 commit comments

Comments
 (0)