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

Commit 7a7fdac

Browse files
authored
Merge pull request scala#5244 from retronym/topic/insource-scalacheck
Temporarily insource Scalacheck
2 parents 4e95083 + 1ae80e8 commit 7a7fdac

26 files changed

+3702
-66
lines changed

build.sbt

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ val scalaParserCombinatorsDep = scalaDep("org.scala-lang.modules", "scala-par
6060
val scalaSwingDep = scalaDep("org.scala-lang.modules", "scala-swing")
6161
val scalaXmlDep = scalaDep("org.scala-lang.modules", "scala-xml")
6262
val partestDep = scalaDep("org.scala-lang.modules", "scala-partest", versionProp = "partest")
63-
val scalacheckDep = scalaDep("org.scalacheck", "scalacheck", scope = "it")
6463

6564
// Non-Scala dependencies:
6665
val junitDep = "junit" % "junit" % "4.11"
@@ -562,6 +561,7 @@ lazy val junit = project.in(file("test") / "junit")
562561
fork in Test := true,
563562
libraryDependencies ++= Seq(junitDep, junitInterfaceDep, jolDep),
564563
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"),
564+
testFrameworks -= new TestFramework("org.scalacheck.ScalaCheckFramework"),
565565
unmanagedSourceDirectories in Test := List(baseDirectory.value)
566566
)
567567

@@ -642,7 +642,7 @@ lazy val test = project
642642
.settings(disablePublishing: _*)
643643
.settings(Defaults.itSettings: _*)
644644
.settings(
645-
libraryDependencies ++= Seq(asmDep, partestDep, scalaXmlDep, scalacheckDep),
645+
libraryDependencies ++= Seq(asmDep, partestDep, scalaXmlDep),
646646
libraryDependencies ++= {
647647
// Resolve the JARs for all test/files/lib/*.jar.desired.sha1 files through Ivy
648648
val baseDir = (baseDirectory in ThisBuild).value
@@ -659,6 +659,7 @@ lazy val test = project
659659
fork in IntegrationTest := true,
660660
javaOptions in IntegrationTest += "-Xmx2G",
661661
testFrameworks += new TestFramework("scala.tools.partest.sbt.Framework"),
662+
testFrameworks -= new TestFramework("org.scalacheck.ScalaCheckFramework"),
662663
testOptions in IntegrationTest += Tests.Argument("-Dpartest.java_opts=-Xmx1024M -Xms64M -XX:MaxPermSize=128M"),
663664
testOptions in IntegrationTest += Tests.Argument("-Dpartest.scalac_opts=" + (scalacOptions in Compile).value.mkString(" ")),
664665
testOptions in IntegrationTest += Tests.Setup { () =>

build.xml

+1-20
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ TODO:
319319
<prepareCross name="scala-parser-combinators" />
320320
<prepareCross name="scala-swing"/>
321321
<prepareCross name="partest"/>
322-
<prepareCross name="scalacheck"/>
323322

324323
<artifact:dependencies pathId="asm.classpath" filesetId="asm.fileset">
325324
<dependency groupId="org.scala-lang.modules" artifactId="scala-asm" version="${scala-asm.version}"/>
@@ -339,11 +338,6 @@ TODO:
339338
</artifact:dependencies>
340339
<copy-deps project="partest"/>
341340

342-
<artifact:dependencies pathId="scalacheck.classpath" filesetId="scalacheck.fileset" versionsId="scalacheck.versions">
343-
<artifact:remoteRepository refid="extra-repo"/>
344-
<dependency groupId="org.scalacheck" artifactId="scalacheck${scalacheck.cross}" version="${scalacheck.version.number}" />
345-
</artifact:dependencies>
346-
347341
<artifact:dependencies pathId="repl.deps.classpath" filesetId="repl.fileset" versionsId="repl.deps.versions">
348342
<dependency groupId="jline" artifactId="jline" version="${jline.version}"/>
349343
</artifact:dependencies>
@@ -567,7 +561,6 @@ TODO:
567561
<echo message="scala-swing.version.number = ${scala-swing.version.number}"/>
568562
<echo message="jline.version = ${jline.version}"/>
569563
<echo message="partest.version.number = ${partest.version.number}"/>
570-
<echo message="scalacheck.version.number = ${scalacheck.version.number}"/>
571564

572565
<propertyfile file="versions.properties">
573566
<entry key="starr.version" value="${starr.version}"/>
@@ -577,7 +570,6 @@ TODO:
577570
<entry key="scala-swing.version.number" value="${scala-swing.version.number}"/>
578571
<entry key="jline.version" value="${jline.version}"/>
579572
<entry key="partest.version.number" value="${partest.version.number}"/>
580-
<entry key="scalacheck.version.number" value="${scalacheck.version.number}"/>
581573
</propertyfile>
582574
</then></if>
583575

@@ -922,7 +914,7 @@ TODO:
922914
(but not scala-library, so we filter that one out...)
923915
so we provide them: scala-[library/reflect/compiler], scalap built here,
924916
scala-xml, scala-parser-combinators via external-modules-nocore,
925-
scalacheck as part of `partest.classpath` -->
917+
as part of `partest.classpath` -->
926918
<restrict>
927919
<path refid="partest.classpath"/>
928920
<rsel:not><rsel:or>
@@ -933,17 +925,6 @@ TODO:
933925
<pathelement location="${scala-parser-combinators}"/>
934926
<!-- <pathelement location="${scala-swing}"/> -->
935927

936-
<restrict>
937-
<path refid="scalacheck.classpath"/>
938-
<rsel:not><rsel:or>
939-
<rsel:name name="scala-library*.jar"/>
940-
<rsel:name name="scala-compiler*.jar"/>
941-
<rsel:name name="scala-reflect*.jar"/>
942-
<rsel:name name="scala-parser-combinators*.jar"/>
943-
<rsel:name name="scala-xml*.jar"/>
944-
</rsel:or></rsel:not>
945-
</restrict>
946-
947928
<!-- partest classes specific to the core compiler build -->
948929
<pathelement location="${partest-extras.jar}"/>
949930
<pathelement location="${partest-javaagent.jar}"/>

doc/LICENSE.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ This license is used by the following third-party libraries:
4646
This license is used by the following third-party libraries:
4747

4848
* jline
49+
* scalacheck
4950

5051
### [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
5152
This license is used by the following third-party libraries:

doc/licenses/bsd_scalacheck.txt

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
ScalaCheck LICENSE
2+
3+
Copyright (c) 2007-2013, Rickard Nilsson
4+
All rights reserved.
5+
6+
Permission to use, copy, modify, and distribute this software in source
7+
or binary form for any purpose with or without fee is hereby granted,
8+
provided that the following conditions are met:
9+
10+
1. Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
12+
13+
2. Redistributions in binary form must reproduce the above copyright
14+
notice, this list of conditions and the following disclaimer in the
15+
documentation and/or other materials provided with the distribution.
16+
17+
3. Neither the name of the author nor the names of its contributors
18+
may be used to endorse or promote products derived from this
19+
software without specific prior written permission.
20+
21+
22+
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25+
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32+
SUCH DAMAGE.

src/library/scala/collection/parallel/immutable/package.scala

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ package immutable {
2020
self =>
2121

2222
def apply(idx: Int) = if (0 <= idx && idx < length) elem else throw new IndexOutOfBoundsException("" + idx)
23-
override def seq = throw new UnsupportedOperationException
23+
override def seq: collection.immutable.Seq[T] = new collection.AbstractSeq[T] with collection.immutable.Seq[T] {
24+
override def length: Int = self.length
25+
override def apply(idx: Int): T = self.apply(idx)
26+
override def iterator: Iterator[T] = Iterator.continually(elem).take(length)
27+
override def par: ParSeq[T] = self
28+
}
2429
def update(idx: Int, elem: T) = throw new UnsupportedOperationException
2530

2631
class ParIterator(var i: Int = 0, val until: Int = length, elem: T = self.elem) extends SeqSplitter[T] {

0 commit comments

Comments
 (0)