HEADS UP: running tests in /tmp and the `extra_files` setup function

Thomas Miedema thomasmiedema at gmail.com
Tue May 17 16:11:53 UTC 2016


Hello GHC developers,

the testsuite driver now runs each test in a temporary directory in /tmp,
after first linking/copying all files that the test requires to that
directory.

When adding a new test:

** if your test requires source files that don't start with the name of
your test, then you *have to* specify those files using the `extra_files`
setup function. [1]*

* you no longer have to specify files to cleanup (`clean_files` and
`clean_cmd` are deprecated)

* you no longer have to add generated files to `testsuite/.gitignore`

* you no longer have to worry about two tests possibly overwriting each
others intermediate (.o, .hi) files, and you no longer have to
specify `-outputdir` if you want to let multiple tests use the same source
files.

Example:

*BEFORE:*
    test('driver011',
         extra_clean(['A011.hi', 'A011.o']),
         run_command,
         ['$MAKE -s --no-print-directory test011'])

*AFTER:*
    test('driver011',
         extra_files(['A011.hs']),
         run_command,
         ['$MAKE -s --no-print-directory test011'])

See https://ghc.haskell.org/trac/ghc/ticket/11980 and
https://ghc.haskell.org/trac/ghc/wiki/Building/RunningTests/Adding for more
information.

Cheers,
Thomas

[1] Extra files for existing tests are currently listed in
`testsuite/driver/extra_files.py`.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160517/176e43af/attachment-0001.html>


More information about the ghc-devs mailing list