diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-07-19 17:33:17 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-08-20 16:16:02 -0700 |
commit | 473a1692abf4d64e5df81cd19be214fe5bfa06ec (patch) | |
tree | c5f26f42296e3e585fe211b5a4e93f7c45d3b543 /src/scalacheck/org/scalacheck/ScalaCheckFramework.scala | |
parent | 738441cf58136bd4af9985886dd0cd38ccda0777 (diff) | |
download | scala-473a1692abf4d64e5df81cd19be214fe5bfa06ec.tar.gz scala-473a1692abf4d64e5df81cd19be214fe5bfa06ec.tar.bz2 scala-473a1692abf4d64e5df81cd19be214fe5bfa06ec.zip |
Move partest to https://github.com/scala/scala-partest
As partest is now resolved from maven, `test/partest` uses `ant test.suite.init`
to determine the classpath (serialized to build/pack/partest.properties)
that's necessary to run `scala.tools.partest.nest.ConsoleRunner`.
Thus, partest gets exactly the same classpath, whether run from
the command line through `test/partest` or via `ant test`.
The version of partest we're using is specified by
properties defined in versions.properties (formerly `starr.number`).
Currently, we're using:
```
scala.binary.version=2.11.0-M4
partest.version.number=1.0-RC3
```
NOTES:
- The version of Scala being tested must be backwards binary compatible with
the version of Scala that was used to compile partest.
- Once 2.11 goes final, `scala.binary.version=2.11`, and `starr.version=2.11.0`.
- Need scalacheck on classpath for test/partest scalacheck tests.
- Removed atrophied ant tests (haven't been run/changed for at least two years
I checked 81d659141a as a "random" sample).
- Removed scalacheck. It's resolved as a partest dependency.
- For now, use a locally built scalap
- Kept the trace macro in the main repo (partest-extras)
- New targets for faster pr validation: test-core-opt, test-stab-opt
- Reused partest eclipse/intellij project to partest-extras
(note: the partest dependency is hard-coded)
Diffstat (limited to 'src/scalacheck/org/scalacheck/ScalaCheckFramework.scala')
-rw-r--r-- | src/scalacheck/org/scalacheck/ScalaCheckFramework.scala | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/src/scalacheck/org/scalacheck/ScalaCheckFramework.scala b/src/scalacheck/org/scalacheck/ScalaCheckFramework.scala deleted file mode 100644 index 7764101844..0000000000 --- a/src/scalacheck/org/scalacheck/ScalaCheckFramework.scala +++ /dev/null @@ -1,92 +0,0 @@ -/*-------------------------------------------------------------------------*\ -** ScalaCheck ** -** Copyright (c) 2007-2013 Rickard Nilsson. All rights reserved. ** -** http://www.scalacheck.org ** -** ** -** This software is released under the terms of the Revised BSD License. ** -** There is NO WARRANTY. See the file LICENSE for the full text. ** -\*------------------------------------------------------------------------ */ - -// vim: set ts=2 sw=2 et: - -package org.scalacheck - -import org.scalatools.testing._ - -class ScalaCheckFramework extends Framework { - - private case object PropFingerprint extends TestFingerprint { - val superClassName = "org.scalacheck.Prop" - val isModule = false - } - - private case object PropsFingerprint extends TestFingerprint { - val superClassName = "org.scalacheck.Properties" - val isModule = true - } - - val name = "ScalaCheck" - - val tests = Array[Fingerprint](PropsFingerprint, PropsFingerprint) - - def testRunner(loader: ClassLoader, loggers: Array[Logger]) = new Runner2 { - - private def asEvent(nr: (String, Test.Result)) = nr match { - case (n: String, r: Test.Result) => new Event { - val testName = n - val description = n - val result = r.status match { - case Test.Passed => Result.Success - case _:Test.Proved => Result.Success - case _:Test.Failed => Result.Failure - case Test.Exhausted => Result.Skipped - case _:Test.PropException | _:Test.GenException => Result.Error - } - val error = r.status match { - case Test.PropException(_, e, _) => e - case _:Test.Failed => new Exception(Pretty.pretty(r,Pretty.Params(0))) - case _ => null - } - } - } - - def run(testClassName: String, fingerprint: Fingerprint, handler: EventHandler, args: Array[String]) { - - val testCallback = new Test.TestCallback { - override def onPropEval(n: String, w: Int, s: Int, d: Int) = {} - - override def onTestResult(n: String, r: Test.Result) = { - for (l <- loggers) { - import Pretty._ - l.info( - (if (r.passed) "+ " else "! ") + n + ": " + pretty(r, Params(0)) - ) - } - handler.handle(asEvent((n,r))) - } - } - - import Test.cmdLineParser.{Success, NoSuccess} - val prms = Test.cmdLineParser.parseParams(args) match { - case Success(params, _) => - params.copy(_testCallback = testCallback, _customClassLoader = Some(loader)) - // TODO: Maybe handle this a bit better than throwing exception? - case e: NoSuccess => throw new Exception(e.toString) - } - - fingerprint match { - case fp: SubclassFingerprint => - if(fp.isModule) { - val obj = Class.forName(testClassName + "$", true, loader) - val ps = obj.getField("MODULE$").get(null).asInstanceOf[Properties] - Test.checkProperties(prms, ps) - } else { - val p = Class.forName(testClassName, true, loader).newInstance.asInstanceOf[Prop] - handler.handle(asEvent((testClassName, Test.check(prms, p)))) - } - } - } - - } - -} |