diff options
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | tools/test-installed-numpy.py | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml index 6cf83d8f9..6949be4bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,12 @@ matrix: include: - python: 2.7 env: NPY_SEPARATE_COMPILATION=0 - - python: 3.2 + - python: 3.3 env: NPY_SEPARATE_COMPILATION=0 + - python: 2.7 + env: NPY_RELAXED_STRIDES_CHECKING=1 + - python: 3.3 + env: NPY_RELAXED_STRIDES_CHECKING=1 before_install: - uname -a - free -m diff --git a/tools/test-installed-numpy.py b/tools/test-installed-numpy.py index ac917b05f..e9c374e9b 100644 --- a/tools/test-installed-numpy.py +++ b/tools/test-installed-numpy.py @@ -12,7 +12,7 @@ from __future__ import division # But, python2.4's -m switch only works with top-level modules, not modules # that are inside packages. So, once we drop 2.4 support, maybe... -import sys +import sys, os # In case we are run from the source directory, we don't want to import numpy # from there, we want to import the installed version: sys.path.pop(0) @@ -35,6 +35,17 @@ parser.add_option("-m", "--mode", (options, args) = parser.parse_args() import numpy + +# Check that NPY_RELAXED_STRIDES_CHECKING is active when set. +# The same flags check is also used in the tests to switch behavior. +if (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "0") != "0"): + if not numpy.ones((10,1), order='C').flags.f_contiguous: + print('NPY_RELAXED_STRIDES_CHECKING set, but not active.') + sys.exit(1) +elif numpy.ones((10,1), order='C').flags.f_contiguous: + print('NPY_RELAXED_STRIDES_CHECKING not set, but active.') + sys.exit(1) + result = numpy.test(options.mode, verbose=options.verbose, extra_argv=args, |