mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user