saidsay-so / pjdfstest

A file system test suite to assess the correctness of file system implementations in terms of POSIX compliance.
https://saidsay-so.github.io/pjdfstest/
Other
8 stars 1 forks source link

Use PWD instead of TMPDIR #59

Closed asomers closed 2 years ago

asomers commented 2 years ago

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 which prove was invoked. The rewrite should either do the same or take the directory to test as a mandatory positional argument.

saidsay-so commented 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?

saidsay-so commented 2 years ago

Or better, create a subdirectory in the CWD (or provided argument) which is cleaned automatically except if the user switch it off.

asomers commented 2 years ago

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.

saidsay-so commented 2 years ago

Alright, I will just keep cleaning then and CWD by default with optional argument.