File size: 3,107 Bytes
c011401 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
======================================================= F2PY unit testing site ======================================================= .. Contents:: Tests ----- * To run all F2PY unit tests in one command:: cd tests python run_all.py [<options>] For example:: localhost:~/src_cvs/f2py2e/tests$ python2.2 run_all.py 100 --quiet ********************************************** Running '/usr/bin/python2.2 f77/return_integer.py 100 --quiet' run 1000 tests in 1.87 seconds initial virtual memory size: 3952640 bytes current virtual memory size: 3952640 bytes ok ********************************************** Running '/usr/bin/python2.2 f77/return_logical.py 100 --quiet' run 1000 tests in 1.47 seconds initial virtual memory size: 3952640 bytes current virtual memory size: 3952640 bytes ok ... If some tests fail, try to run the failing tests separately (without the ``--quiet`` option) as described below to get more information about the failure. * Test intent(in), intent(out) scalar arguments, scalars returned by F77 functions and F90 module functions:: tests/f77/return_integer.py tests/f77/return_real.py tests/f77/return_logical.py tests/f77/return_complex.py tests/f77/return_character.py tests/f90/return_integer.py tests/f90/return_real.py tests/f90/return_logical.py tests/f90/return_complex.py tests/f90/return_character.py Change to tests/ directory and run:: python f77/return_<type>.py [<options>] python f90/return_<type>.py [<options>] where ``<type>`` is integer, real, logical, complex, or character. Test scripts options are described below. A test is considered succesful if the last printed line is "ok". If you get import errors like:: ImportError: No module named f77_ext_return_integer but ``f77_ext_return_integer.so`` exists in the current directory then it means that the current directory is not included in to `sys.path` in your Python installation. As a fix, prepend ``.`` to ``PYTHONPATH`` environment variable and rerun the tests. For example:: PYTHONPATH=. python f77/return_integer.py * Test mixing Fortran 77, Fortran 90 fixed and free format codes:: tests/mixed/run.py * Test basic callback hooks:: tests/f77/callback.py Options ------- You may want to use the following options when running the test scripts: ``<integer>`` Run tests ``<integer>`` times. Useful for detecting memory leaks. Under Linux tests scripts output virtual memory size state of the process before and after calling the wrapped functions. ``--quiet`` Suppress all messages. On success only "ok" should be displayed. ``--fcompiler=<Gnu|Intel|...>`` Use:: f2py -c --help-fcompiler to find out what compilers are available (or more precisely, which ones are recognized by ``numpy_distutils``). Reporting failures ------------------ XXX: (1) make sure that failures are due to f2py and (2) send full stdout/stderr messages to me. Also add compiler,python,platform information. |