In my project, I have a lot of different cram test directories and they each use some of the same scripts to sanitize output, check for files, stuff like that. Right now, I just duplicate each of the helper scripts into the cram test directories so they are available to the test. Something like this:
- test
- bar.t
- run.t
- sanitize.pl
- foo.t
- run.t
- sanitize.pl # this is the same file as above
I would like to be able to organize them like this, so that the sanitize.pl
script isn’t duplicated.
- test
- bar.t
- run.t
- foo.t
- run.t
- scripts
- sanitize.pl
I tried to refer to the script in my cram tests using the PWD
or $(pwd)
and then using a relative path from that. While that does point to the correct file, in terms of the actual test, none of the files outside of the current test dir (eg, bar.t
) are actually present in the sandboxed test (eg, I don’t have access to any files outside of bar.t
during the test).
tl;dr
Is there any way to have shared “helper scripts” in cram tests when using dune?