jmid / mutaml

An OCaml mutation tester
BSD 2-Clause "Simplified" License
65 stars 4 forks source link

`mutaml-runner` should set an environment variable to indicate which files are mutated #6

Open raphael-proust opened 1 year ago

raphael-proust commented 1 year ago

To avoid running all the tests for all the mutations, mutaml-runner could set an environment variable MUTAML_MUTATED_FILES containing a list of files that have mutations active. This would allow to condition a test so that it only runs if the code that it tests is part of the files that are mutated.

jmid commented 1 year ago

This is a clever suggestion to delegate to the tests which ones to run or not - and using an environment variable to communicate that to the test child process.

On the other hand, I suppose dune also knows all the dependencies since it is using very similar logic to avoid recompiling and rerunning tests needlessly. I thus wonder whether it is possible to hook into and reuse... :thinking: