A testing tool for Scala and Java developers
Scala Other
Permalink
Failed to load latest commit information.
ant-lib initial version for github, created from current version of ScalaTest… Apr 9, 2013
common-test.js/src/main/scala/org/scalatest Rewritten LineNumberHelper using macro. May 21, 2015
common-test/src/main/scala/org/scalatest Reorganized imports. Jun 21, 2016
examples/src/test Updated TimeLimitedTests about Signaler, and fixed the broken examples. May 19, 2016
lib initial version for github, created from current version of ScalaTest… Apr 9, 2013
nbproject initial version for github, created from current version of ScalaTest… Apr 9, 2013
notes Changes to notes for 2.2.0 release. Jun 8, 2014
project Added FiniteFloat and FiniteDouble. Jan 18, 2017
scalactic-macro/src/main Added FiniteFloat and FiniteDouble. Jan 18, 2017
scalactic-test/src/test/scala/org/scalactic Added FiniteFloat and FiniteDouble. Jan 18, 2017
scalactic/src/main Move Present from package org.scalactic.anyvals to org.scalactic, and… Jan 16, 2017
scalatest-test/src Removed Checkers.scala and CheckersSuite.scala in the org.scalatest.p… Dec 15, 2016
scalatest.js/src/main/scala/org/scalatest Fixed timer not canceled problem in TimeLimitedTests. Oct 17, 2016
scalatest/src/main Removed Checkers.scala and CheckersSuite.scala in the org.scalatest.p… Dec 15, 2016
support Change scenariosFor to ScenariosFor Dec 13, 2016
webapp Added remaining html5 input tags Jul 14, 2013
.gitattributes Added .gitattributes file that contains settings to use unix-style EOL. Apr 9, 2013
.gitignore Work in progress scalatest.js. Mar 6, 2015
.travis.yml Changed travis to use Scala 2.12.0. Nov 7, 2016
2.9_excludes Renamed scalautils to scalactic. Apr 24, 2014
LICENSE initial version for github, created from current version of ScalaTest… Apr 9, 2013
NOTICE initial version for github, created from current version of ScalaTest… Apr 9, 2013
README.md Changed to use scala 2.12.0 in README. Nov 7, 2016
addmem.sh initial version for github, created from current version of ScalaTest… Apr 9, 2013
build.xml Removed the use of no-specialization in both ant and sbt build. May 14, 2014
migration.txt initial version for github, created from current version of ScalaTest… Apr 9, 2013
osgi.bnd Renamed scalautils to scalactic. Apr 24, 2014
pom_template.xml Fix OSGi tests Apr 10, 2014
scalactic-osgi.bnd Renamed scalautils to scalactic. Apr 24, 2014
scalactic-pom_template.xml Renamed scalautils to scalactic. Apr 24, 2014
todo.txt Renamed Spec and SpecLike to RefSpec and RefSpecLike, moved them into… Nov 13, 2015
travis_build.sh Added another testQuick try for RegularTests4 in travis. Jun 8, 2016
updateCopyright.bash added bash script to update Copyright to current year and added all j… Aug 29, 2013
use-ldquo-and-rdquo.bash script to replace “ with “ and ” with ” and r… Sep 8, 2013

README.md

ScalaTest

Build Status

ScalaTest is a free, open-source testing toolkit for Scala and Java programmers.

Official Website: http://www.scalatest.org/

Using ScalaTest

Setup

Please visit Download and Setup for download and setup instructions.

Quick Start

Please visit Quick Start for steps to get started quickly.

Building ScalaTest

Pre-Requisites

The followings are needed for building ScalaTest:

for JDK 6 or 7, use the following options in your SBT launch file:

SBT_OPTS="-server -Xms512M -Xmx3000M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:NewRatio=8 -XX:MaxPermSize=512M"

for JDK 8, use the following SBT options instead:

SBT_OPTS="-server -Xms512M -Xmx3000M -Xss1M  -XX:+UseConcMarkSweepGC -XX:NewRatio=8"

Building and Running Tests

This command will build and run the regular tests:

$ sbt test

To run generated all tests, you'll need to increase maximum heap size to -Xmx5000M, and use this command instead:

$ sbt gentests/test

You can also run different groups generated tests separately:

$ sbt genMustMatchersTests1/test
$ sbt genMustMatchersTests2/test
$ sbt genMustMatchersTests3/test
$ sbt genMustMatchersTests4/test
$ sbt genGenTests/test
$ sbt genTablesTests/test
$ sbt genInspectorsTests/test
$ sbt genInspectorsShorthandsTests1/test
$ sbt genInspectorsShorthandsTests2/test
$ sbt genTheyTests/test
$ sbt genContainTests1/test
$ sbt genContainTests2/test
$ sbt genSortedTests/test
$ sbt genLoneElementTests/test
$ sbt genEmptyTests/test
$ sbt genSafeStyleTests/test

What it does is simply switch to gentests project and run test.

Building Exmaples

You can build examples project using this command:

$ sbt examples/compile

Packaging

You can package the ScalaTest JAR file using this command:

$ sbt package

The resulting JAR file will be produced in target/scala-2.11/.

You can also publish it to your local Ivy repository using this command:

$ sbt publishLocal

Or publish it to local maven repository using this command:

$ sbt publishM2

Publishing

To publish to Sonatype, you first need to make sure you have the following:

  • A GPG client is installed on your command line path. For more information, please refer to GNU Privacy Guard Website.
  • You have created your GPG keys and distributed your public key to hkp://pool.sks-keyservers.net/. For more information, please refer to How To Generate PGP Signatures With Maven.
  • You have been granted the right to publish using org.scalatest and org.scalactic domain.

By default, ScalaTest build will read your Sonatype credentials from ~/.ivy2/.credentials, which is a properties file that looks like this:

realm=Sonatype Nexus Repository Manager
host=oss.sonatype.org
user=xxxxxxxx
password=xxxxxxxx

You can use SCALATEST_NEXUS_LOGIN and SCALATEST_NEXUS_PASSWORD environment variables to override Sonatype credentials.

For signing, ScalaTest build will use ~/.gnupg/secring.gpg by default and prompt for GPG passphase if required. Alternatively you can use SCALATEST_GPG_FILE to use a different GPG file, and use SCALATEST_GPG_PASSPHASE to provide GPG passphase to avoid input prompt.

If you would like to export a particular private key into a separate GPG file, you can use the following command:

$ gpg --export-secret-keys example@example.com > example-secret-key.gpg

With Sonatype credentials and GPG file in place, you can now publish to Sonatype.

To publish scalactic, scalatest and scalatest-app (for Scala and Scala-js, version 2.11 and 2.10, and make sure you're on Java 6) to Sonatype, use the following command:

$ sbt clean publishSigned "project scalatestAppJS" clean publishSigned ++2.10.6 "project scalatestApp" clean publishSigned "project scalatestAppJS" clean publishSigned

To publish scalactic, scalatest and scalatest-app (for Scala and Scala-js, version 2.12, and make sure you're on Java 8) to Sonatype, use the following command:

$ sbt ++2.12.0 clean publishSigned "project scalatestAppJS" clean publishSigned