@@ -21,32 +21,32 @@ src = module('..src')
2121python_libs = python .instance ().libs
2222features |= runpath (src .bpl .path , base = '' )
2323
24- def extension_test (name , ext = [], script = None , np = False ,
24+ def extension_test (name , exts = [], script = None , numpy = False ,
2525 features = features , condition = None ):
2626 """Create a Python extension test `name`.
2727 Arguments:
2828 * name: the name of the test.
29- * ext : extensions to be compiled, <name> if none are given.
29+ * exts : extensions to be compiled, <name> if none are given.
3030 * script: the test script to execute, <name>.py if none is given.
31- * np : if true, add boost_numpy to sources
31+ * numpy : if true, add boost_numpy to sources
3232 * features: pre-defined features
3333 * condition: any condition under which to run the test
3434 Return:
3535 * the test artefact"""
3636
3737 features = features .copy ()
3838 extensions = []
39- libs = [src .bnl , src .bpl ] if np else [src .bpl ]
40- for e in ext or [name ]:
41- if type (e ) is str : # build from a single source file
42- n = e if e != name else e + '_ext'
43- s = [e + '.cpp' ]
39+ libs = [src .bnl , src .bpl ] if numpy else [src .bpl ]
40+ for ext in exts or [name ]:
41+ if type (ext ) is str : # build from a single source file
42+ ext_name = ext if ext != name else ext + '_ext'
43+ sources = [ext + '.cpp' ]
4444 else : # build from a list of source files
45- n = e [0 ] if e [0 ] != name else e [0 ] + '_ext'
46- s = [n + '.cpp' for n in e ]
47- e = extension (n , s + libs , features = features )
48- features |= pythonpath (e .path , base = '' )
49- extensions .append (e )
45+ ext_name = ext [0 ] if ext [0 ] != name else ext [0 ] + '_ext'
46+ sources = [source + '.cpp' for source in ext ]
47+ ext = extension (ext_name , sources + libs , features = features )
48+ features |= pythonpath (ext .path , base = '' )
49+ extensions .append (ext )
5050 if not script :
5151 script = name + '.py'
5252 return test (name , script , run = python .run , dependencies = extensions ,
@@ -167,7 +167,7 @@ for t in ['numpy/dtype',
167167 'numpy/ndarray' ,
168168 'numpy/indexing' ,
169169 'numpy/shapes' ]:
170- tests .append (extension_test (t , np = True ,
170+ tests .append (extension_test (t , numpy = True ,
171171 condition = set .define .contains ('HAS_NUMPY' )))
172172
173173default = report ('report' , tests , fail_on_failures = True )
0 commit comments