Closed asomers closed 2 years ago
I think that taking the CWD by default and taking an optional argument rather than a mandatory positional one would be better. Also, since the files are cleaned automatically after exit, should we keep this behavior and provide an option to switch it off or let the created files?
Or better, create a subdirectory in the CWD (or provided argument) which is cleaned automatically except if the user switch it off.
CWD by default with an optional argument seems fine to me. As for the other thing, why would you want to switch off cleanup? If you're thinking that it would be handy for debugging, in my experience that isn't as useful as it sounds. Skipping cleanup can cause subsequent tests to fail, and by the time everything is done it's not always obvious which temporary files were associated with which test. Better to just run the failing test with a debugger.
Alright, I will just keep cleaning then and CWD by default with optional argument.
TestContext::new
creates a new temporary directory in the default location, which is usually /tmp . However, in actual use users will be testing their file system under development, which may be mounted anywhere. That's why the original pjdfstest operates in the PWD from whichprove
was invoked. The rewrite should either do the same or take the directory to test as a mandatory positional argument.