Idris-dev/test
Niklas Larsson 9662ab5e4a Disable travis for GHC 8.8 (libffi still broken)
Update changelog

Use GHC 8.8 in Appveyor

Run legacy test commands
2020-01-25 18:48:50 +01:00
..
base001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic008 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic009 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic010 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic011 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic012 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic013 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic014 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic015 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic016 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic017 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic018 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic019 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic020 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic021 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic022 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic023 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic024 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic025 Rename expected, input and run 2020-01-25 01:44:54 +01:00
basic026 Rename expected, input and run 2020-01-25 01:44:54 +01:00
bignum001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
bignum002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
bignum003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
bounded001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
buffer001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
buffer002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
contrib001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
corecords001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
corecords002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
delab001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
directives001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
directives002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
directives003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
disambig002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
docs001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
docs002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
docs003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
docs004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
docs005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
docs006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
dsl001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
dsl002 Disable travis for GHC 8.8 (libffi still broken) 2020-01-25 18:48:50 +01:00
dsl003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
dsl004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
effects001 Disable travis for GHC 8.8 (libffi still broken) 2020-01-25 18:48:50 +01:00
effects002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
effects003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
effects004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
effects005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
error001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
error002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
error003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
error004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
error005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
error006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
error007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
error008 Rename expected, input and run 2020-01-25 01:44:54 +01:00
error009 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi008 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi009 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi010 Rename expected, input and run 2020-01-25 01:44:54 +01:00
ffi011 Disable travis for GHC 8.8 (libffi still broken) 2020-01-25 18:48:50 +01:00
ffi012 Disable travis for GHC 8.8 (libffi still broken) 2020-01-25 18:48:50 +01:00
ffi013 Rename expected, input and run 2020-01-25 01:44:54 +01:00
folding001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
idrisdoc001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
idrisdoc002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
idrisdoc003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
idrisdoc004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
idrisdoc005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
idrisdoc006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
idrisdoc007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
idrisdoc008 Rename expected, input and run 2020-01-25 01:44:54 +01:00
idrisdoc009 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive008 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive009 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive010 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive011 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive012 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive013 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive014 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive015 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive016 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive017 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interactive018 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces008 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces009 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interfaces010 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interpret001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interpret002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
interpret003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
io001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
io002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
io003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
layout001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
literate001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
meta001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
meta002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
meta003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
meta004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pkg001 Merge remote-tracking branch 'origin/master' into ghc-8.8 2020-01-25 03:58:36 +01:00
pkg002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pkg003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pkg004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pkg005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pkg006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pkg007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pkg008 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pkg009 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pkg010 Disable travis for GHC 8.8 (libffi still broken) 2020-01-25 18:48:50 +01:00
prelude001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
primitives001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
primitives002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
primitives003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
primitives004-disabled Rename expected, input and run 2020-01-25 01:44:54 +01:00
primitives005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
primitives006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof008 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof009 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof010 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proof011 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proofsearch001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proofsearch002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
proofsearch003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
pruviloj001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
quasiquote001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
quasiquote002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
quasiquote003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
quasiquote004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
quasiquote005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
quasiquote006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
records001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
records002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
records003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
records004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
records005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg013 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg016 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg017 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg020 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg024 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg025 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg027 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg029 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg031 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg032 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg039 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg040 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg041 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg042 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg045 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg048 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg051-disabled Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg052 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg067 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg075 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg076 Rename expected, input and run 2020-01-25 01:44:54 +01:00
reg077 Rename expected, input and run 2020-01-25 01:44:54 +01:00
regression001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
regression002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
regression003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
scripts Move timeout from test/bin/ to test/scripts/ 2016-08-07 21:35:42 +10:00
sourceLocation001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
st001 Disable travis for GHC 8.8 (libffi still broken) 2020-01-25 18:48:50 +01:00
st002 Disable travis for GHC 8.8 (libffi still broken) 2020-01-25 18:48:50 +01:00
st003 Disable travis for GHC 8.8 (libffi still broken) 2020-01-25 18:48:50 +01:00
st004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
st005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
st006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
st007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
sugar001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
sugar002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
sugar003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
sugar004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
sugar005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
syntax001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
syntax002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
tactics001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality008 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality009 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality010 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality011 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality012 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality013 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality014 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality015 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality016 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality017 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality018 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality019 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality020 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality021 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality022 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality023 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality024 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality025 Rename expected, input and run 2020-01-25 01:44:54 +01:00
totality026 Rename expected, input and run 2020-01-25 01:44:54 +01:00
tutorial001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
tutorial002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
tutorial003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
tutorial004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
tutorial005 Rename expected, input and run 2020-01-25 01:44:54 +01:00
tutorial006 Rename expected, input and run 2020-01-25 01:44:54 +01:00
tutorial007 Rename expected, input and run 2020-01-25 01:44:54 +01:00
unique001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
unique004 Rename expected, input and run 2020-01-25 01:44:54 +01:00
universes001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
universes002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
views001 Rename expected, input and run 2020-01-25 01:44:54 +01:00
views002 Rename expected, input and run 2020-01-25 01:44:54 +01:00
views003 Rename expected, input and run 2020-01-25 01:44:54 +01:00
mktest.pl Fix warning for implicitable names 2016-02-13 13:27:30 +00:00
README.md Rename expected, input and run 2020-01-25 01:44:54 +01:00
TestData.hs fix Core.Execute and test 2019-07-10 15:59:25 +03:00
TestRun.hs Rename expected, input and run 2020-01-25 01:44:54 +01:00

Idris' Testing Suite

Running the test suite

Do make test_c or make test_js. It will run the tests in parallel and through cabal test. You can also manually call cabal test or stack test.

Passing arguments

To the test program

You can pass arguments to the test program. For example, to pass the --help argument:

# Via make
make TEST-ARGS="--help" test_c
# Via cabal
cabal test --test-options="--help"
# Via stack
stack test --test-arguments="--help"

Try it to learn more about the other arguments you can provide. Two are of particular interest: --node to test against the Node code generator and --pattern <regex> to only run the test that match the provided <regex>.

To idris

You can pass arguments to idris in each of its invocation by the tests. There are two ways to this. You can either modify the idrisFlags term in TestRun, or set the $IDRIS environment variable accordingly

Specifying the number of parallel jobs

With make, the test suite runs in parallel by default. You can specify the number of threads with TEST-JOBS. For stack and cabal, you need to explicitly enable parallelism as you would do with any other GHC-compiled executable. Examples:

# Two test jobs via make
make TEST-JOBS=2 test_c
# Two test jobs via cabal
cabal test --test-options="+RTS -N2 -RTS"
# Two test jobs via stack
stack test --test-arguments="+RTS -N2 -RTS"

Running only previously failed tests

Because of the --rerun-update option, make test_c will create a .tasty-rerun-log file in the root directory of the project. Each time the test suite is run, the file will be written with the result of the tests. The next time you do make test, you can specify the rerun-filter argument to, for example, only run previously failed tests. Valid values are given in the --help.

Extending the test suite

Content of the directory

To each test there shall be a folder that holds at least a bash script run and a golden file expected. When running the test suite, the standard output of the script is compared against the golden file. Any mismatch is reported as a failure.

The name of a test folder is the identifier of the test family followed by a three digit number. A test family gathers related tests.

Add to that four top level files:

  • The program TestRun.hs that runs the test suite
  • A Haskell module TestData.hs with the metadata for each test
  • The Perl script mktest.pl to ease the creation of a new test
  • This README.md

Test families

Tests are categorised with the following test families (and their identifiers):

  • basic: Basic language features, some complete programs
  • bignum: Bignums and GMP
  • bounded: Bounds testing for bits
  • corecords: Tests for corecord
  • delab: De-elaboration tests
  • directives: Tests for directives
  • disambig: Disambiguaton tests
  • docs: Testing documentation functionality
  • dsl: Embedded DSLs and features to support DSL development
  • effects: Effects package
  • error: Error messages and error reflection
  • ffi: FFI calls, including type providers
  • folding Testing some folds
  • idrisdoc: Documentation tool functionality
  • interactive: Interactive editing, proof search
  • interfaces: Testing interfaces.
  • io: IO monad
  • literate: .lidr files; literate programming
  • meta: Meta-programming
  • pkg: Packages
  • primitives: Primitive types
  • proof: Theorem proving, tactics
  • proofsearch: Proof search
  • pruviloj: Elaborator reflection
  • quasiquote: Quasiquotations
  • records: Records
  • reg: Regression tests, covering previous bug fixes
  • regression: Regression tests, covering previous bug fixes
  • sourceLocation: Interaction with files from Idris
  • st: ST, state transition systems
  • sugar: Syntactic sugar, syntax extensions
  • syntax: Syntax extensions
  • tactics: Testing for tactics
  • totality: Totality checking
  • tutorial: Examples from the tutorial
  • unique: Uniqueness types
  • universes: Universes
  • views: Views and covering functions

Adding a test family

  1. Choose an available identifier for your test family. It should be short and somewhat self-explanatory.
  2. Add it in the README.md file, i.e. just above.
  3. Add it in TestData.hs, in the testFamiliesData list. Say the chosen identifier is foo. You should append to the list ("foo", "A proper name for foo", [ ]). The empty list will be replaced with the metadata of each test in the family.
  4. Add your tests.

Adding a test

  1. Choose the family your test shall belong to and remember its identifier.
  2. Pick the next available integer in the test family. It will be the index.
  3. Say the family's identifier is foo and the index is 42. You should call ./mktest.pl foo042 ; this will create the directory and a simple run.sh script.
  4. Modify the run script to your liking. If you want to call the idris executable, write ${IDRIS:-idris} $@.
  5. Add any file you may need in the directory. If they don't end in .idr, you should remember them for the next step.
  6. Add your test in TestData.hs. Each family has a list of (Index, CompatCodegen). See the next section for the available values in CompatCodegen. In most cases, you should write ( 42, ANY).
  7. Generate the expected.out file by doing:
    # Using cabal
    cabal test --test-options="--pattern foo042 --accept"
    # Using stack
    stack test --test-arguments="--pattern foo042 --accept"
    
  8. Check the content of expected.out. Maybe the test didn't do what you thought it would. Fix and go back to 7 until it's ok.

Specifying compatible backends

Some tests only make sense with specific code generators. Others don't generate code. You need to supply this information in testFamiliesData. Available values for the compatible backends are:

  • ANY: choose this if your test will work with any code generator
  • C_CG: choose this to only test against the C code generator
  • NODE_CG: choose this to only test against the Node code generator
  • NONE: choose this if you don't want your test to be run with multiple code generators (mainly for tests that only perform type checking)

Currently, NONE has the same effect as ANY, but this will change.

Removing a test

  1. Delete the corresponding directory
  2. Remove the corresponding line in the definition of testFamiliesData in TestData.hs

Updating golden files

To update the expected.out file for every test, do one of the following:

# Using make
make test_update
# Using cabal
cabal test --test-options="--accept"
# Using stack
stack test --test-arguments="--accept"

"Accepted" tests are the ones that update the golden file. A test can still fail if the run.sh script itself crashes.