Skip to content

Commit

Permalink
Merge pull request #3101 from larsrh/update/scalatest
Browse files Browse the repository at this point in the history
update ScalaTest
  • Loading branch information
larsrh authored Oct 5, 2019
2 parents befc276 + 1a0cee5 commit 92c1dd1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 29 deletions.
38 changes: 12 additions & 26 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@ val isTravisBuild = settingKey[Boolean]("Flag indicating whether the current bui
val crossScalaVersionsFromTravis = settingKey[Seq[String]]("Scala versions set in .travis.yml as scala_version_XXX")
isTravisBuild in Global := sys.env.get("TRAVIS").isDefined

val scalatestVersion = "3.1.0-SNAP13"

val scalatestplusScalaCheckVersion = "1.0.0-SNAP8"

val scalaCheckVersion = "1.14.2"

val disciplineVersion = "1.0.0"
val scalatestplusScalaCheckVersion = "3.1.0.0-RC2"

val disciplineScalatestVersion = "1.0.0-M1"
val disciplineVersion = "1.0.1"

val kindProjectorVersion = "0.10.3"
val disciplineScalatestVersion = "1.0.0-RC1"

val kindProjectorVersion = "0.11.0"

crossScalaVersionsFromTravis in Global := {
val manifest = (baseDirectory in ThisBuild).value / ".travis.yml"
Expand Down Expand Up @@ -96,7 +94,7 @@ def macroDependencies(scalaVersion: String) =
lazy val catsSettings = Seq(
incOptions := incOptions.value.withLogRecompileOnMacro(false),
libraryDependencies ++= Seq(
compilerPlugin("org.typelevel" %% "kind-projector" % kindProjectorVersion)
compilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full))
) ++ macroDependencies(scalaVersion.value)
) ++ commonSettings ++ publishSettings ++ scoverageSettings ++ simulacrumSettings

Expand Down Expand Up @@ -168,9 +166,8 @@ lazy val disciplineDependencies = Seq(

lazy val testingDependencies = Seq(
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % scalatestVersion % "test",
"org.scalatestplus" %%% "scalatestplus-scalacheck" % scalatestplusScalaCheckVersion % "test",
"org.typelevel" %%% "discipline-scalatest" % disciplineScalatestVersion % "test"
"org.typelevel" %%% "discipline-scalatest" % disciplineScalatestVersion % "test",
"org.scalatestplus" %%% "scalatestplus-scalacheck" % scalatestplusScalaCheckVersion % "test"
)
)

Expand Down Expand Up @@ -571,12 +568,7 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform)
.settings(moduleName := "cats-tests")
.settings(catsSettings)
.settings(noPublishSettings)
.settings(
libraryDependencies ++= Seq(
"org.scalatestplus" %%% "scalatestplus-scalacheck" % scalatestplusScalaCheckVersion,
"org.typelevel" %%% "discipline-scalatest" % disciplineScalatestVersion
)
)
.settings(testingDependencies)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)
.settings(scalacOptions in Test := (scalacOptions in Test).value.filter(_ != "-Xfatal-warnings"))
Expand All @@ -589,11 +581,6 @@ lazy val testkit = crossProject(JSPlatform, JVMPlatform)
.settings(moduleName := "cats-testkit")
.settings(catsSettings)
.settings(disciplineDependencies)
.settings(
libraryDependencies ++= Seq(
"org.scalacheck" %%% "scalacheck" % scalaCheckVersion
)
)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)
.settings(scalacOptions := scalacOptions.value.filter(_ != "-Xfatal-warnings"))
Expand Down Expand Up @@ -664,17 +651,17 @@ lazy val binCompatTest = project
// see https://github.com/typelevel/cats/pull/3026#discussion_r321984342
useCoursier := false,
commonScalaVersionSettings,
addCompilerPlugin("org.typelevel" %% "kind-projector" % kindProjectorVersion),
addCompilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full)),
libraryDependencies ++= List(
{
if (priorTo2_13(scalaVersion.value))
mimaPrevious("cats-core", scalaVersion.value, version.value).last % Provided
else //We are not testing BC on Scala 2.13 yet.
"org.typelevel" %% "cats-core" % "2.0.0-M4" % Provided
},
"org.scalatest" %%% "scalatest" % scalatestVersion % Test
}
)
)
.settings(testingDependencies)
.dependsOn(core.jvm % Test)

// cats-js is JS-only
Expand Down Expand Up @@ -857,7 +844,6 @@ def priorTo2_13(scalaVersion: String): Boolean =
lazy val sharedPublishSettings = Seq(
releaseTagName := tagName.value,
releaseVcsSign := true,
useGpg := true, // bouncycastle has bugs with subkeys, so we use gpg instead
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := Function.const(false),
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test/scala/cats/tests/CatsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import cats.platform.Platform
import cats.syntax._
import org.scalactic.anyvals.{PosInt, PosZDouble, PosZInt}
import org.scalatest.funsuite.AnyFunSuiteLike
import org.scalatest.Matchers
import org.scalatest.matchers.should.Matchers
import org.scalatest.prop.Configuration
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.typelevel.discipline.scalatest.Discipline
Expand Down
5 changes: 3 additions & 2 deletions tests/src/test/scala/cats/tests/SemigroupSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cats
package tests

import org.scalatest._
import org.scalatest.matchers.should.Matchers
import org.scalatest.funsuite._
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks

class SemigroupSuite extends AnyFunSuiteLike with Matchers with GeneratorDrivenPropertyChecks {
class SemigroupSuite extends AnyFunSuiteLike with Matchers with ScalaCheckDrivenPropertyChecks {
{
import cats.implicits._
Invariant[Semigroup]
Expand Down

0 comments on commit 92c1dd1

Please sign in to comment.