summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2013-04-02 20:01:57 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2013-04-02 21:22:57 +0200
commit507b09e523e11610ea7f9bf3350b2258120ab0d2 (patch)
tree0178c2ae6a07c9594629884ffca529c5bf2f4e02
parent7af1c6701673187b7d895b7646204d774bffc557 (diff)
downloadnumpy-507b09e523e11610ea7f9bf3350b2258120ab0d2.tar.gz
TST: Add NPY_RELAXED_STRIDES_CHECKING to Travis
-rw-r--r--.travis.yml6
-rw-r--r--tools/test-installed-numpy.py13
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,