Skip to content
Snippets Groups Projects
Commit 91c11fea authored by Thomas Miedema's avatar Thomas Miedema
Browse files

testsuite: format commands using config dict

Summary:
Allow `cmd_wrapper` to return a format string that can refer to config values.
Very useful! This allows for many tests to be defined in pure Python, instead
of in an additional script or Makefile.

Example:

  def Thpc(cmd):
    return(cmd + ' && {hpc} report Thpc.tix')
  test('Thpc', [cmd_wrapper(Thpc), only_ways['hpc']), compile_and_run, [''])

The `{hpc}` is replaced by the value of `config.hpc`. The result is that the
module `Thpc` first gets compiled, then the binary `Thpc` is run, and then the
`hpc report` command is run. The output of all of this is redirected
(and later appended) to Thpc.run.stdout/stderr as normally.

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D706
parent 41df51d5
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment