GithubHelp home page GithubHelp logo

hubertpolkowski / scala-partest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scala/scala-partest

0.0 1.0 0.0 1.19 MB

Testing framework for the Scala compiler and standard library.

Home Page: http://docs.scala-lang.org/scala

License: BSD 3-Clause "New" or "Revised" License

Shell 2.70% Scala 97.30%

scala-partest's Introduction

scala-partest

Partest is the testing framework used to regression-test the Scala compiler and standard library.

The compiler under test is instantiated by partest to compile the test files (or directories) under the test sources directory (test/files by default). The test's output is compared against the expected output specified by the corresponding .check file. Failed tests will (typically) have a log file (test/files/$kind/$testName-$kind.log) that differs from their check file (test/files/$kind/$testName.check).

Test categories (subdirectories under test/files)

  • pos: these files must compile successfully
  • run: in addition to compiling, Test.main is run and its output is compared against the test's .check file
  • neg: these files must not compile, with compiler output matching the expected output in the .check file
  • jvm: JVM-specific run tests

As partest links directly against the compiler being tested, it's cross-versioned against the compiler version that it's intended for.

There are three ways of invoking partest:

The compiler to be tested must be on the classpath. The corresponding jar or class directory is detected by FileManager::findArtifact.

The classpath to run partest is specific to the compiler/libraries under test (script not included here, but see the main test/partest script). It must provide the scala compiler to be tested and all its dependencies, and of course a compatible version of partest. For details on the available arguments, see the ConsoleRunner argument spec. Here are some non-obvious useful options:

  • --failed: run only failed tests (ones that have a log file)
  • --update-check: overwrite check files with log files (where the latter exists)
  • -Dpartest.scalac_opts=... -> add compiler options
  • -Dpartest.debug=true -> print debug messages

Advanced usage:

  • tests may consist of multiple files (the test name is the directory's name), and files (including java sources) in that directory are compiled in order by looking at _$N suffixes before the file's extension and compiling them grouped by $N, in ascending order.
  • jars in test/files/lib are expected to be on the classpath and may be used by tests
  • certain kinds of tests (scalacheck/instrumented/specialized) add additional jars to the classpath

System properties available to tests:

  • partest.output: output directory (where classfiles go)
  • partest.lib: the path of the library (jar or class dir) being tested
  • partest.reflect: the path of scala-reflect (jar or class dir) being tested
  • partest.comp: the path of the compiler (jar or class dir) being tested
  • partest.cwd: partest working dir
  • partest.test-path
  • partest.testname

scala-partest's People

Contributors

paulp avatar phaller avatar adriaanm avatar som-snytt avatar lrytz avatar xeno-by avatar retronym avatar sethtisue avatar vladureche avatar gkossakowski avatar szeiger avatar odersky avatar soc avatar jsuereth avatar dragos avatar gourlaysama avatar vigdorchik avatar namin avatar khernyo avatar xuwei-k avatar heathermiller avatar kzys avatar dotta avatar rkuhn avatar tiarkrompf avatar gzm0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.