[h5py] 168/455: Test infrastructure improvements
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.
commit 78c2779474263a47bfcbef5a7a4f77da60fa6657
Author: andrewcollette <andrew.collette at gmail.com>
Date: Sun Nov 30 06:36:55 2008 +0000
Test infrastructure improvements
---
autotest.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
h5py/__init__.py | 4 ++--
h5py/tests/__init__.py | 2 +-
3 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/autotest.py b/autotest.py
new file mode 100644
index 0000000..f92e4a5
--- /dev/null
+++ b/autotest.py
@@ -0,0 +1,50 @@
+# Development script to test setup options
+import os.path as op
+import os, sys
+
+# Versions of the Python interpreter to test
+python_versions = ['python2.5', 'python2.6']
+
+# Expect these to exist in parent dir
+libnames = ['h166', 'h167', 'h180', 'h181', 'h182']
+
+# Additional options for each library version
+extraopts = {'h181': ['--api=16']}
+
+def runcmd(cmd, logfile=None):
+ """ Execute a command, capturing output in a logfile.
+
+ Logfile is deleted if command succeeds. Aborts Python if
+ exit code is exactly 1, else returns that value.
+ """
+
+ print "Executing %s" % cmd
+ retval = os.system('%s > %s 2>&1' % (cmd, logfile if logfile is not None else '/dev/null'))
+ if retval in (1,2):
+ print "Exiting with internal exception"
+ sys.exit(1)
+ elif retval != 0:
+ print '!!! Command "%s" failed with status %s; output saved to %s' % (cmd, retval, logfile)
+ elif logfile is not None:
+ os.unlink(logfile)
+
+ return retval
+
+retvals = []
+
+for p in python_versions:
+ for l in libnames:
+ opts = ['']+extraopts.get(l,[])
+
+ for i, o in enumerate(opts):
+
+ outfile = 'autotest-%s-%s-%s.txt' % (l, i, p)
+
+ retvals.append(runcmd('%s setup.py build --hdf5=../%s %s' % (p, l, o), outfile))
+ retvals.append(runcmd('%s setup.py test' % p))
+ retvals.append(runcmd('%s setup.py clean' % p))
+
+print 'Done'
+
+sys.exit(int(any(retvals))*17)
+
diff --git a/h5py/__init__.py b/h5py/__init__.py
index fd086fa..69deb37 100644
--- a/h5py/__init__.py
+++ b/h5py/__init__.py
@@ -23,10 +23,10 @@ __doc__ = \
"""
try:
import h5
-except ImportError:
+except ImportError, e:
import os.path as op
if op.exists('setup.py'):
- raise ImportError("Exit source directory before importing h5py")
+ raise ImportError('Import error:\n"%s"\n\nBe sure to exit source directory before importing h5py' % e)
raise
import utils, h5, h5a, h5d, h5f, h5g, h5i, h5p, h5r, h5s, h5t, h5z, highlevel, version
diff --git a/h5py/tests/__init__.py b/h5py/tests/__init__.py
index 5d3a512..82f754a 100644
--- a/h5py/tests/__init__.py
+++ b/h5py/tests/__init__.py
@@ -76,7 +76,7 @@ def runtests(requests=None, verbosity=1):
def autotest():
try:
if not runtests():
- sys.exit(1)
+ sys.exit(17)
except:
sys.exit(2)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git
More information about the debian-science-commits
mailing list