summaryrefslogtreecommitdiff
path: root/numpy/linalg
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-11-08 06:51:42 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-11-08 06:51:42 +0000
commit319ff38951b9ffc1f8fe366bcbc087cd7ffcd96a (patch)
tree6c69da671765deca3794c8fc7eb3daabcad6149e /numpy/linalg
parent419cd5b72fd061fb5207e5c609d1ca33bda39ca9 (diff)
downloadnumpy-319ff38951b9ffc1f8fe366bcbc087cd7ffcd96a.tar.gz
Start working on test to detect fortran compiler mismatch.
Diffstat (limited to 'numpy/linalg')
-rw-r--r--numpy/linalg/tests/test_build.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/numpy/linalg/tests/test_build.py b/numpy/linalg/tests/test_build.py
new file mode 100644
index 000000000..ccba19bb1
--- /dev/null
+++ b/numpy/linalg/tests/test_build.py
@@ -0,0 +1,35 @@
+from subprocess import call, PIPE, Popen
+import sys
+import re
+
+import numpy as np
+from numpy.testing import TestCase
+
+class FindDependenciesLdd:
+ def __init__(self):
+ self.cmd = ['ldd']
+
+ try:
+ st = call(self.cmd, stdout=PIPE, stderr=PIPE)
+ except OSError:
+ raise RuntimeError("command %s cannot be run" % self.cmd)
+
+ def get_dependencies(self, file):
+ p = Popen(self.cmd + [file], stdout=PIPE, stderr=PIPE)
+ stdout, stderr = p.communicate()
+ if not (p.returncode == 0):
+ raise RuntimeError("Failed to check dependencies for %s" % libfile)
+
+ return stdout
+
+ def grep_dependencies(self, file, deps):
+ stdout = self.get_dependencies(file)
+
+ rdeps = dict([(dep, re.compile(dep)) for dep in deps])
+ founds = []
+ for l in stdout.splitlines():
+ for k, v in rdeps.items():
+ if v.search(l):
+ founds.append(k)
+
+ return founds