From 22ab4731cf0622ec30adb5b44dfc7b9dd0d0358f Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Jun 2022 04:43:49 +0000 Subject: [PATCH 1/3] Reduce min tests for native factors suite --- .../scala/spire/math/prime/FactorsScalaCheckSuite.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/shared/src/test/scala/spire/math/prime/FactorsScalaCheckSuite.scala b/tests/shared/src/test/scala/spire/math/prime/FactorsScalaCheckSuite.scala index e83393d7c..18f9e39e6 100644 --- a/tests/shared/src/test/scala/spire/math/prime/FactorsScalaCheckSuite.scala +++ b/tests/shared/src/test/scala/spire/math/prime/FactorsScalaCheckSuite.scala @@ -29,6 +29,12 @@ import org.scalacheck.Prop._ class FactorsScalaCheckSuite extends munit.ScalaCheckSuite { + override def scalaCheckTestParameters = + if (sys.props.get("java.vm.name").contains("Scala Native")) + // Native is stupidly slow for this suite + super.scalaCheckTestParameters.withMinSuccessfulTests(5) + else super.scalaCheckTestParameters + implicit val arbitraryFactors: Arbitrary[Factors] = Arbitrary(arbitrary[SafeLong].map(n => Factors(n))) From 127b328e25e05c8f3f43c1273fa32c7a5c9ae2d1 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Jun 2022 05:08:22 +0000 Subject: [PATCH 2/3] Less replicates for native in more suites --- .../test/scala/spire/math/PolynomialScalaCheckSuite.scala | 6 ++++++ .../test/scala/spire/math/QuaternionScalaCheckSuite.scala | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tests/shared/src/test/scala/spire/math/PolynomialScalaCheckSuite.scala b/tests/shared/src/test/scala/spire/math/PolynomialScalaCheckSuite.scala index 20d272981..b8fb8678d 100644 --- a/tests/shared/src/test/scala/spire/math/PolynomialScalaCheckSuite.scala +++ b/tests/shared/src/test/scala/spire/math/PolynomialScalaCheckSuite.scala @@ -32,6 +32,12 @@ import org.scalacheck.Prop class PolynomialScalaCheckSuite extends munit.ScalaCheckSuite { + override def scalaCheckTestParameters = + if (sys.props.get("java.vm.name").contains("Scala Native")) + // Native is stupidly slow for this suite + super.scalaCheckTestParameters.withMinSuccessfulTests(5) + else super.scalaCheckTestParameters + import PolynomialSetup._ val ebd = Eq[BigDecimal] diff --git a/tests/shared/src/test/scala/spire/math/QuaternionScalaCheckSuite.scala b/tests/shared/src/test/scala/spire/math/QuaternionScalaCheckSuite.scala index 63993f923..70cfa193b 100644 --- a/tests/shared/src/test/scala/spire/math/QuaternionScalaCheckSuite.scala +++ b/tests/shared/src/test/scala/spire/math/QuaternionScalaCheckSuite.scala @@ -23,6 +23,12 @@ import org.scalacheck.Prop._ class QuaternionScalaCheckSuite extends munit.ScalaCheckSuite { + override def scalaCheckTestParameters = + if (sys.props.get("java.vm.name").contains("Scala Native")) + // Native is stupidly slow for this suite + super.scalaCheckTestParameters.withMinSuccessfulTests(5) + else super.scalaCheckTestParameters + type H = Quaternion[Real] val zero = Quaternion.zero[Real] val one = Quaternion.one[Real] From f2fca72db27761e2b6823c46b51dfba03d4b08ce Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Jun 2022 05:24:47 +0000 Subject: [PATCH 3/3] Less replicates for another suite --- .../test/scala/spire/math/AlgebraicScalaCheckSuite.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/shared/src/test/scala/spire/math/AlgebraicScalaCheckSuite.scala b/tests/shared/src/test/scala/spire/math/AlgebraicScalaCheckSuite.scala index aabe0b06f..a72c8e744 100644 --- a/tests/shared/src/test/scala/spire/math/AlgebraicScalaCheckSuite.scala +++ b/tests/shared/src/test/scala/spire/math/AlgebraicScalaCheckSuite.scala @@ -27,6 +27,12 @@ import MathContext.{DECIMAL128, DECIMAL64} class AlgebraicScalaCheckSuite extends munit.ScalaCheckSuite { + override def scalaCheckTestParameters = + if (sys.props.get("java.vm.name").contains("Scala Native")) + // Native is stupidly slow for this suite + super.scalaCheckTestParameters.withMinSuccessfulTests(5) + else super.scalaCheckTestParameters + def approximation(approx0: Algebraic, scale: Int, actual: BigDecimal): Unit = { val error = BigDecimal(10).pow(-scale) val approx = approx0.toBigDecimal(scale, RoundingMode.HALF_EVEN)