From 473a1692abf4d64e5df81cd19be214fe5bfa06ec Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 19 Jul 2013 17:33:17 -0700 Subject: 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) --- src/scalacheck/org/scalacheck/Properties.scala | 96 -------------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/scalacheck/org/scalacheck/Properties.scala (limited to 'src/scalacheck/org/scalacheck/Properties.scala') diff --git a/src/scalacheck/org/scalacheck/Properties.scala b/src/scalacheck/org/scalacheck/Properties.scala deleted file mode 100644 index d4836d7420..0000000000 --- a/src/scalacheck/org/scalacheck/Properties.scala +++ /dev/null @@ -1,96 +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. ** -\*------------------------------------------------------------------------ */ - -package org.scalacheck - -/** Represents a collection of properties, with convenient methods - * for checking all properties at once. This class is itself a property, which - * holds if and only if all of the contained properties hold. - *

Properties are added in the following way:

- * - * {{{ - * object MyProps extends Properties("MyProps") { - * property("myProp1") = forAll { (n:Int, m:Int) => - * n+m == m+n - * } - * - * property("myProp2") = ((0/1) throws classOf[ArithmeticException]) - * } - * }}} - */ -class Properties(val name: String) extends Prop { - - import Test.cmdLineParser.{Success, NoSuccess} - - private val props = new scala.collection.mutable.ListBuffer[(String,Prop)] - - /** Returns one property which holds if and only if all of the - * properties in this property collection hold */ - private def oneProperty: Prop = Prop.all((properties map (_._2)):_*) - - /** Returns all properties of this collection in a list of name/property - * pairs. */ - def properties: Seq[(String,Prop)] = props - - def apply(p: Prop.Params) = oneProperty(p) - - /** Convenience method that checks the properties with the given parameters - * and reports the result on the console. If you need to get the results - * from the test use the `check` methods in [[org.scalacheck.Test]] - * instead. */ - override def check(prms: Test.Parameters): Unit = Test.checkProperties( - prms copy (_testCallback = ConsoleReporter(1) chain prms.testCallback), this - ) - - /** Convenience method that checks the properties with the given parameters - * and reports the result on the console. If you need to get the results - * from the test use the `check` methods in [[org.scalacheck.Test]] - * instead. - * @deprecated (in 1.10.0) Use `check(Test.Parameters)` instead. - */ - @deprecated("Use 'check(Test.Parameters)' instead", "1.10.0") - override def check(prms: Test.Params): Unit = Test.checkProperties( - prms copy (testCallback = ConsoleReporter(1) chain prms.testCallback), this - ) - - /** Convenience method that checks the properties and reports the - * result on the console. If you need to get the results from the test use - * the `check` methods in [[org.scalacheck.Test]] instead. */ - override def check: Unit = check(Test.Parameters.default) - - /** The logic for main, separated out to make it easier to - * avoid System.exit calls. Returns exit code. - */ - override def mainRunner(args: Array[String]): Int = { - Test.cmdLineParser.parseParams(args) match { - case Success(params, _) => - val res = Test.checkProperties(params, this) - val failed = res.filter(!_._2.passed).size - failed - case e: NoSuccess => - println("Incorrect options:"+"\n"+e+"\n") - Test.cmdLineParser.printHelp - -1 - } - } - - /** Adds all properties from another property collection to this one. */ - def include(ps: Properties) = for((n,p) <- ps.properties) property(n) = p - - /** Used for specifying properties. Usage: - * {{{ - * property("myProp") = ... - * }}} - */ - class PropertySpecifier() { - def update(propName: String, p: Prop) = props += ((name+"."+propName, p)) - } - - lazy val property = new PropertySpecifier() -} -- cgit v1.2.3