SamirTalwar / smoke

Runs tests against anything, using command-line arguments, STDIN, STDOUT and STDERR.
MIT License
89 stars 10 forks source link

Support for a way to run the same kind of test on many files #39

Open SamirTalwar opened 4 years ago

SamirTalwar commented 4 years ago

One use case for Smoke is to simply provide many different potential input and output files, and compare them. However, it gets old doing the following:

tests:
  - name: thing 1
    stdin:
      file: thing1.in
    stdout:
      file: thing1.out

  - name: thing 2
    stdin:
      file: thing2.in
    stdout:
      file: thing2.out

  - name: thing 3
    stdin:
      file: thing3.in
    stdout:
      file: thing3.out

# ...

Not only is it monotonous, but error-prone.

@jaspervdj suggested finding a better way to avoid this repetition, just like goldplate does.

SamirTalwar commented 4 years ago

Perhaps we could do something like this:

tests:
  - name: %
    stdin:
      file: *.in
    stdout:
      file: %.out

This would detect the glob expression in stdin.file, and expand it to the long form above, using % as the placeholder for the pattern matched by *.

SamirTalwar commented 4 years ago

Alternatively, we could look at Dhall as a way of programmatically generating configuration files safely.

jonaprieto commented 1 year ago

Using Dhall would be quite nice, indeed.