diff options
author | Seth Tisue <seth@tisue.net> | 2017-01-23 14:35:47 -0800 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2017-01-27 09:29:53 -0800 |
commit | 4386b948a0b597cc78e4f3b22b51e0588a5b6d60 (patch) | |
tree | eca8cea41d110d8b14d27a83ae06a90e966f9621 /test/scalacheck/parallel-collections/pc.scala | |
parent | 27c10db549e6f43571663d0162b58fc04fbb34bf (diff) | |
download | scala-4386b948a0b597cc78e4f3b22b51e0588a5b6d60.tar.gz scala-4386b948a0b597cc78e4f3b22b51e0588a5b6d60.tar.bz2 scala-4386b948a0b597cc78e4f3b22b51e0588a5b6d60.zip |
run ScalaCheck tests directly, not through partest
ScalaCheck ever being under partest in the first place is ancient
history, from back in the Ant build days (shudder)
ScalaCheck support was removed from partest 1.1.0, which we already
upgraded to in a recent commit
also upgrades ScalaCheck from 1.11.6 to 1.13.4, since we might
as well. no source changes were necessary.
Diffstat (limited to 'test/scalacheck/parallel-collections/pc.scala')
-rw-r--r-- | test/scalacheck/parallel-collections/pc.scala | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/scalacheck/parallel-collections/pc.scala b/test/scalacheck/parallel-collections/pc.scala new file mode 100644 index 0000000000..10d0643be8 --- /dev/null +++ b/test/scalacheck/parallel-collections/pc.scala @@ -0,0 +1,61 @@ +// package here to be able access the package-private implementation and shutdown the pool +package scala + +import org.scalacheck._ +import scala.collection.parallel._ + +class ParCollProperties extends Properties("Parallel collections") { + + def includeAllTestsWith(support: TaskSupport, descriptor: String) { + // parallel arrays with default task support + include(new mutable.IntParallelArrayCheck(support, descriptor) { }) + + // parallel ranges + include(new immutable.ParallelRangeCheck(support, descriptor) { }) + + // parallel immutable hash maps (tries) + include(new immutable.IntIntParallelHashMapCheck(support, descriptor) { }) + + // parallel immutable hash sets (tries) + include(new immutable.IntParallelHashSetCheck(support, descriptor) { }) + + // parallel mutable hash maps (tables) + include(new mutable.IntIntParallelHashMapCheck(support, descriptor) { }) + + // parallel ctrie + include(new mutable.IntIntParallelConcurrentTrieMapCheck(support, descriptor) { }) + + // parallel mutable hash sets (tables) + include(new mutable.IntParallelHashSetCheck(support, descriptor) { }) + + // parallel vectors + include(new immutable.IntParallelVectorCheck(support, descriptor) { }) + } + + includeAllTestsWith(defaultTaskSupport, "defaultTaskSupport") + + val ec = scala.concurrent.ExecutionContext.fromExecutorService(java.util.concurrent.Executors.newFixedThreadPool(5)) + val ectasks = new collection.parallel.ExecutionContextTaskSupport(ec) + includeAllTestsWith(ectasks, "ectasks") + + // no post test hooks in scalacheck, so cannot do: + // ec.shutdown() + +} + +/* +def main(args: Array[String]) { + val pc = new ParCollProperties + org.scalacheck.Test.checkProperties( + org.scalacheck.Test.Params( + rng = new java.util.Random(5134L), + testCallback = new ConsoleReporter(0), + workers = 1, + minSize = 0, + maxSize = 4000, + minSuccessfulTests = 5 + ), + pc + ) +} +*/ |