Skip to content
Grégoire Détrez edited this page Jun 18, 2013 · 6 revisions

The standard way to run tests, which is also the command that travis is using:

cabal configure --enable-tests && cabal build && cabal test

Note that the test suites have additional dependencies that you will need to install in order to be able to run the tests, you can do that automatically with cabal: cabal install --enable-tests --only-dependencies

There is an script in the bnf source directory, runtests.sh which does it for you with some small differences:

  • it uses cabal-dev instead of cabal
  • it tries to set your CLASSPATH variable for you (It has only been tested on linux so far)

Skipping system tests

Since we don't expect all bnfc contributors to have installed a compiler for every backend, there is a mechanism, based on cabal flags, that allows you to skipped some of the system tests based on the target language. For instance, if you don't have a JDK nor the ocaml environment you can use the following command:

cabal configure --enable-tests -f-java-tests -f-ocaml-tests && cabal build && cabal test

The possible flags are:

  • haskell-tests
  • java-tests
  • c-tests
  • cpp-tests
  • latex-tests
  • ocaml-tests
Clone this wiki locally