tests: Store temporary directory on failure
It is not very useful to just delete the data again after a failure, as it might be useful for debugging. Just store it into an "errors" subdirectory of the PWD in the hope that this is a sane location. Note that it'll error out if the directory already exists, but that should be acceptable in all cases. i.e. it won't exist in the CI and developers can just wipe the directory.
This commit is contained in:
parent
e5fa54e8e7
commit
4f29a32da8
1 changed files with 5 additions and 0 deletions
|
@ -87,6 +87,11 @@ try:
|
|||
if os.path.exists(os.path.join(ddir, "custom.ioctl")):
|
||||
custom()
|
||||
|
||||
except:
|
||||
# Store created output files for inspection (in the build directory)
|
||||
outdir = os.path.join('errors', os.path.basename(ddir))
|
||||
shutil.copytree(tmpdir, outdir)
|
||||
|
||||
finally:
|
||||
shutil.rmtree(tmpdir)
|
||||
|
||||
|
|
Loading…
Reference in a new issue