[Numpy-discussion] running numpy tests

Andrew Dalke dalke@dalkescientific....
Mon Aug 4 18:15:36 CDT 2008


I'm working on the patches for reducing the import overhead.  I want  
to make sure I don't break anything.  I'm trying to figure out how to  
run all of the tests.  I expected, based on the following

Alan McIntyre wrote:
> They actually do two different things; numpy.test() runs test for all
> of numpy, and numpy.testing.test() runs tests for numpy.testing only.
> There are similar functions in numpy.lib, numpy.core, etc.

Robert Kern wrote:
> By now, we have most
> of the denizens here trained to do numpy.test() when testing their new
> installations.


README:
> After installation, tests can be run (from outside the source
> directory) with:
>
> python -c 'import numpy; numpy.test()'


that 'numpy.test()' runs everthing.


When I run numpy.test() I don't seem to run all of the tests.  That  
is, I don't see the output I get when I run numpy.lib.test() .   
Here's a copy of my output, to show you what I mean.  Also, I can't  
figure out what when I run a test I get a new Python prompt.


Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy
 >>> numpy.test()
Running unit tests for numpy
NumPy version 1.2.0.dev5595
NumPy is installed in /Library/Frameworks/Python.framework/Versions/ 
2.5/lib/python2.5/site-packages/numpy
Python version 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1  
(Apple Computer, Inc. build 5341)]
nose version 0.10.3
Not implemented: Defined_Binary_Op
Not implemented: Defined_Binary_Op
Defined_Operator not defined used by Generic_Spec
Needs match implementation: Allocate_Stmt
Needs match implementation: Associate_Construct
     .... many lines removed ....
Needs match implementation: Target_Stmt
Needs match implementation: Type_Bound_Procedure_Part
Needs match implementation: Where_Construct
-----
Nof match implementation needs: 51 out of 224
Nof tests needs: 224 out of 224
Total number of classes: 529
-----
No module named test_derived_scalar_ext , recompiling  
test_derived_scalar_ext.
Parsing '/tmp/tmpyQVvVI.f90'..
Generating interface for test_derived_scalar_ext Subroutine:  
f2py_test_derived_scalar_ext_foo
Generating interface for test_derived_scalar_ext.myt: f2py_type_myt_32
Generating interface for Integer: npy_int32
Generating interface for test_derived_scalar_ext Subroutine:  
f2py_test_derived_scalar_ext_f2pywrap_foo2
setup arguments: ' build_ext --build-temp tmp/ext_temp --build-lib  
tmp build_clib --build-temp tmp/clib_temp --build-clib tmp/clib_clib'
running build_ext
running build_src
building library "test_derived_scalar_ext_fortran_f2py" sources
building library "test_derived_scalar_ext_f_wrappers_f2py" sources
building extension "test_derived_scalar_ext" sources
running build_clib
customize UnixCCompiler
customize UnixCCompiler using build_clib
customize NAGFCompiler
    ... 12 lines removed as it tries to find a compiler ...
customize Gnu95FCompiler
Found executable /usr/local/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using build_clib
building 'test_derived_scalar_ext_fortran_f2py' library
compiling Fortran sources
Fortran f77 compiler: /usr/local/bin/gfortran -Wall -ffixed-form -fno- 
second-underscore -fPIC -O3 -funroll-loops
Fortran f90 compiler: /usr/local/bin/gfortran -Wall -fno-second- 
underscore -fPIC -O3 -funroll-loops
Fortran fix compiler: /usr/local/bin/gfortran -Wall -ffixed-form -fno- 
second-underscore -Wall -fno-second-underscore -fPIC -O3 -funroll-loops
creating tmp/clib_temp
creating tmp/clib_temp/tmp
compile options: '-c'
gfortran:f90: /tmp/tmpyQVvVI.f90
creating tmp/clib_clib
ar: adding 1 object files to tmp/clib_clib/ 
libtest_derived_scalar_ext_fortran_f2py.a
ranlib:@ tmp/clib_clib/libtest_derived_scalar_ext_fortran_f2py.a
building 'test_derived_scalar_ext_f_wrappers_f2py' library
compiling Fortran sources
Fortran f77 compiler: /usr/local/bin/gfortran -Wall -ffixed-form -fno- 
second-underscore -fPIC -O3 -funroll-loops
Fortran f90 compiler: /usr/local/bin/gfortran -Wall -fno-second- 
underscore -fPIC -O3 -funroll-loops
Fortran fix compiler: /usr/local/bin/gfortran -Wall -ffixed-form -fno- 
second-underscore -Wall -fno-second-underscore -fPIC -O3 -funroll-loops
compile options: '-c'
gfortran:f90: tmp/test_derived_scalar_ext_f_wrappers_f2py.f90
ar: adding 1 object files to tmp/clib_clib/ 
libtest_derived_scalar_ext_f_wrappers_f2py.a
ranlib:@ tmp/clib_clib/libtest_derived_scalar_ext_f_wrappers_f2py.a
customize UnixCCompiler
customize UnixCCompiler using build_ext
    ... about 15 lines removed ...
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'test_derived_scalar_ext' extension
compiling C sources
C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/ 
MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp  
-mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3

creating tmp/ext_temp
creating tmp/ext_temp/tmp
compile options: '-I/Library/Frameworks/Python.framework/Versions/2.5/ 
lib/python2.5/site-packages/numpy/core/include -I/Library/Frameworks/ 
Python.framework/Versions/2.5/include/python2.5 -c'
gcc: tmp/test_derived_scalar_extmodule.c
/usr/local/bin/gfortran -Wall -Wall -undefined dynamic_lookup -bundle  
tmp/ext_temp/tmp/test_derived_scalar_extmodule.o -L/usr/local/lib/gcc/ 
i686-apple-darwin8/4.2.1 -Ltmp/clib_clib - 
ltest_derived_scalar_ext_f_wrappers_f2py - 
ltest_derived_scalar_ext_fortran_f2py -lgfortran -o tmp/ 
test_derived_scalar_ext.so
Removing build directory tmp/ext_temp
Removing build directory tmp/clib_temp
Removing build directory tmp/clib_clib
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy.lib
 >>> numpy.lib.test()
Running unit tests for numpy.lib
NumPy version 1.2.0.dev5595
NumPy is installed in /Library/Frameworks/Python.framework/Versions/ 
2.5/lib/python2.5/site-packages/numpy
Python version 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1  
(Apple Computer, Inc. build 5341)]
nose version 0.10.3
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
........................................................................ 
.................................................................
----------------------------------------------------------------------
Ran 1001 tests in 4.497s

OK
<nose.result.TextTestResult run=1001 errors=0 failures=0>


Also, when I do the suggested

    python -c 'import numpy; numpy.test()'

I get output very much like when I did things interactively, except  
the last lines of the output are:

   ...
gcc: tmp/test_derived_scalar_extmodule.c
/usr/local/bin/gfortran -Wall -Wall -undefined dynamic_lookup -bundle  
tmp/ext_temp/tmp/test_derived_scalar_extmodule.o -L/usr/local/lib/gcc/ 
i686-apple-darwin8/4.2.1 -Ltmp/clib_clib - 
ltest_derived_scalar_ext_f_wrappers_f2py - 
ltest_derived_scalar_ext_fortran_f2py -lgfortran -o tmp/ 
test_derived_scalar_ext.so
Removing build directory tmp/ext_temp
Removing build directory tmp/clib_temp
Removing build directory tmp/clib_clib
Argument expected for the -c option
usage: /Library/Frameworks/Python.framework/Versions/2.5/Resources/ 
Python.app/Contents/MacOS/Python [option] ... [-c cmd | -m mod | file  
| -] [arg] ...
Try `python -h' for more information.



				Andrew
				dalke@dalkescientific.com




More information about the Numpy-discussion mailing list