upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRomain PINSOLLE <romain.pins@gmail.com>2026-11-24 16:11:09 +0100
committerRomain PINSOLLE <romain.pins@gmail.com>2026-11-24 16:11:09 +0100
commit3de809cf6db9507ca679c5f2ca0919abe98b75b6 (patch)
tree0ff05f6d6b467700205b4bb908f10d5aa25df404 /scripts
parenta28927849adb4e40dfdec8c32fb6758dcd205a37 (diff)
run_wine_tests: note and carry on when the drive cannot be mapped (WINE-DRIVE-MAP-OSERROR)
DriveMap.__enter__ handled only FileExistsError. A prefix whose dosdevices folder cannot be written aborted the run with a traceback before any test. Any OSError while mapping now sets a note and leaves the drive unmapped; the scratch folder is removed as before. Tests: the old drive-setup test asserted the traceback; it now checks the note, the cleanup and that __enter__ does not raise. A second test covers a scratch folder that cannot be created.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/run_wine_tests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/run_wine_tests.py b/scripts/run_wine_tests.py
index 8435f7fb9..65908e1f3 100644
--- a/scripts/run_wine_tests.py
+++ b/scripts/run_wine_tests.py
@@ -67,7 +67,8 @@ class DriveMap:
67 <root>/runtime/build/generated/x.spv. The drive is a dosdevices link to a scratch folder holding a/Leonida/Leonida 67 <root>/runtime/build/generated/x.spv. The drive is a dosdevices link to a scratch folder holding a/Leonida/Leonida
68 as a link to the root. If the Windows checkout is the drive root itself, the drive links directly to the 68 as a link to the root. If the Windows checkout is the drive root itself, the drive links directly to the
69 Linux checkout. Temporary links and scratch folders are removed afterwards. A drive the prefix already has 69 Linux checkout. Temporary links and scratch folders are removed afterwards. A drive the prefix already has
70 (c:, z:, or one set up by hand) is left alone, and so is a root without an absolute drive path. 70 (c:, z:, or one set up by hand) is left alone, and so is a root without an absolute drive path. A prefix that
71 cannot take the link (read-only, permission denied) also leaves the drive unmapped; the note says why.
71 """ 72 """
72 73
73 def __init__(self, windows_root: str, root: str, prefix: str): 74 def __init__(self, windows_root: str, root: str, prefix: str):
@@ -104,6 +105,10 @@ class DriveMap:
104 self.note = already_set 105 self.note = already_set
105 return self 106 return self
106 self.link = link 107 self.link = link
108 except OSError as e:
109 # A read-only or otherwise unwritable prefix: run the tests without the drive, and say so.
110 self.note = f"cannot map drive {drive}: {e.strerror or e}: the run goes on without it"
111 return self
107 finally: 112 finally:
108 # __exit__ only runs after a successful __enter__. 113 # __exit__ only runs after a successful __enter__.
109 if self.link is None and self.scratch is not None: 114 if self.link is None and self.scratch is not None: