changeset 9394:31203db1b2ac

run-tests: expand --tmpdir and create it if needed
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Sat, 15 Aug 2009 21:19:57 +0900
parents 23c4e772c172
children 163e79e2ed5f
files tests/run-tests.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun Aug 23 14:32:58 2009 +0200
+++ b/tests/run-tests.py	Sat Aug 15 21:19:57 2009 +0900
@@ -167,6 +167,14 @@
     else:
         vlog = lambda *msg: None
 
+    if options.tmpdir:
+        options.tmpdir = os.path.expanduser(options.tmpdir)
+        try:
+            os.makedirs(options.tmpdir)
+        except OSError, err:
+            if err.errno != errno.EEXIST:
+                raise
+
     if options.jobs < 1:
         print >> sys.stderr, 'ERROR: -j/--jobs must be positive'
         sys.exit(1)