]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/python/test/fabscript
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / python / test / fabscript
index 1989cc0d13caf61bea6aa26189e9851027c87a8d..03e4c6f91982ca2c6beb1ed9932125dd0bb6b15b 100644 (file)
@@ -21,14 +21,14 @@ src = module('..src')
 python_libs=python.instance().libs
 features |= runpath(src.bpl.path, base='')
 
-def extension_test(name, ext=[], script=None, np=False,
+def extension_test(name, exts=[], script=None, numpy=False,
                    features=features, condition=None):
     """Create a Python extension test `name`.
     Arguments:
       * name: the name of the test.
-      * ext: extensions to be compiled, <name> if none are given.
+      * exts: extensions to be compiled, <name> if none are given.
       * script: the test script to execute, <name>.py if none is given.
-      * np: if true, add boost_numpy to sources
+      * numpy: if true, add boost_numpy to sources
       * features: pre-defined features
       * condition: any condition under which to run the test
     Return:
@@ -36,17 +36,17 @@ def extension_test(name, ext=[], script=None, np=False,
 
     features=features.copy()
     extensions = []
-    libs = [src.bnl, src.bpl] if np else [src.bpl]
-    for e in ext or [name]:
-        if type(e) is str:  # build from a single source file
-            n = e if e != name else e + '_ext'
-            s = [e + '.cpp']
+    libs = [src.bnl, src.bpl] if numpy else [src.bpl]
+    for ext in exts or [name]:
+        if type(ext) is str:  # build from a single source file
+            ext_name = ext if ext != name else ext + '_ext'
+            sources = [ext + '.cpp']
         else:  # build from a list of source files
-            n = e[0] if e[0] != name else e[0] + '_ext'
-            s = [n + '.cpp' for n in e]
-        e = extension(n, s + libs, features=features)
-        features |= pythonpath(e.path, base='')
-        extensions.append(e)
+            ext_name = ext[0] if ext[0] != name else ext[0] + '_ext'
+            sources = [source + '.cpp' for source in ext]
+        ext = extension(ext_name, sources + libs, features=features)
+        features |= pythonpath(ext.path, base='')
+        extensions.append(ext)
     if not script:
         script = name+'.py'
     return test(name, script, run=python.run, dependencies=extensions,
@@ -123,9 +123,9 @@ tests.append(extension_test('auto_ptr',
 import_ = binary('import_', ['import_.cpp', src.bpl], features=features|python_libs)
 if platform.os == 'Windows':
     command = """set PATH=$(runpath);%PATH%
-$(>[1]) $(>[2])"""
+$(>[0]) $(>[1])"""
 else:
-    command = 'LD_LIBRARY_PATH=$(runpath) $(>[1]) $(>[2])'
+    command = 'LD_LIBRARY_PATH=$(runpath) $(>[0]) $(>[1])'
 
 tests.append(test('import', [import_, 'import_.py'],
                   run=action('run', command),
@@ -167,7 +167,7 @@ for t in ['numpy/dtype',
           'numpy/ndarray',
           'numpy/indexing',
           'numpy/shapes']:
-    tests.append(extension_test(t, np=True,
+    tests.append(extension_test(t, numpy=True,
                                 condition=set.define.contains('HAS_NUMPY')))
 
 default = report('report', tests, fail_on_failures=True)