summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisandro Dalcin <dalcinl@gmail.com>2017-10-18 12:24:19 +0300
committerGitHub <noreply@github.com>2017-10-18 12:24:19 +0300
commit99da4323411cf7a0d83d1dd319c63a65845f8ff7 (patch)
tree715bd7089145efb00ba4a6aa2eb50cc0ec00c80c
parent23e8254fb8c83a5a70e692c9f553acbc37a45f57 (diff)
parentf18a951928f8d5e5ea8260be021bb3d3c15a0037 (diff)
downloadcython-99da4323411cf7a0d83d1dd319c63a65845f8ff7.tar.gz
Merge pull request #1937 from cython/travis-ci
Travis-CI: Setup macOS builds
-rw-r--r--.travis.yml81
-rw-r--r--Cython/Utility/ModuleSetupCode.c11
-rw-r--r--Demos/embed/Makefile3
-rwxr-xr-xruntests.py8
-rw-r--r--tests/travis_macos_cpp_bugs.txt9
5 files changed, 88 insertions, 24 deletions
diff --git a/.travis.yml b/.travis.yml
index 8086fffd7..d91d5443b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,12 +1,20 @@
-language: python
+os: linux
dist: trusty
sudo: false
+addons:
+ apt:
+ packages:
+ - gdb
+ - python-dbg
+ - python3-dbg
+
cache:
pip: true
directories:
- $HOME/.ccache
+language: python
python:
- 2.7
- 3.6
@@ -30,17 +38,67 @@ env:
- BACKEND=c
- BACKEND=cpp
+matrix:
+ include:
+ - os: osx
+ osx_image: xcode6.4
+ env: BACKEND=c PY=2
+ python: 2
+ language: c
+ compiler: clang
+ cache: false
+ - os: osx
+ osx_image: xcode6.4
+ env: BACKEND=cpp PY=2
+ python: 2
+ language: cpp
+ compiler: clang
+ cache: false
+ - os: osx
+ osx_image: xcode6.4
+ env: BACKEND=c PY=3
+ python: 3
+ language: c
+ compiler: clang
+ cache: false
+ - os: osx
+ osx_image: xcode6.4
+ env: BACKEND=cpp PY=3
+ python: 3
+ language: cpp
+ compiler: clang
+ cache: false
+ allow_failures:
+ - python: pypy
+ - python: pypy3
+ - python: 3.6-dev
+ - python: 3.7-dev
+ exclude:
+ - python: pypy
+ env: BACKEND=cpp
+ - python: pypy3
+ env: BACKEND=cpp
+
branches:
only:
- master
- release
+before_install:
+ - |
+ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then # Install Miniconda
+ curl -s -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda$PY-latest-MacOSX-x86_64.sh;
+ bash miniconda.sh -b -p $HOME/miniconda && rm miniconda.sh;
+ export PATH="$HOME/miniconda/bin:$PATH"; hash -r;
+ #conda install --quiet --yes nomkl --file=test-requirements.txt --file=test-requirements-cpython.txt;
+ fi
+
install:
- python -c 'import sys; print("Python %s" % (sys.version,))'
- if [ -n "${TRAVIS_PYTHON_VERSION##*-dev}" -a -n "${TRAVIS_PYTHON_VERSION##2.6*}" ]; then pip install -r test-requirements.txt $( [ -z "${TRAVIS_PYTHON_VERSION##pypy*}" ] || echo " -r test-requirements-cpython.txt" ) ; fi
- CFLAGS="-O2 -ggdb -Wall -Wextra $(python -c 'import sys; print("-fno-strict-aliasing" if sys.version_info[0] == 2 else "")')" python setup.py build
-before_script: ccache -s
+before_script: ccache -s || true
script:
- PYTHON_DBG="python$( python -c 'import sys; print("%d.%d" % sys.version_info[:2])' )-dbg"
@@ -48,22 +106,3 @@ script:
- if [ false && "$BACKEND" = "cpp" ]; then pip install pythran; fi # disabled: needs Pythran > 0.8.1
- CFLAGS="-O2 -ggdb -Wall -Wextra $(python -c 'import sys; print("-fno-strict-aliasing" if sys.version_info[0] == 2 else "")')" python setup.py build_ext -i
- CFLAGS="-O0 -ggdb -Wall -Wextra" python runtests.py -vv -x Debugger --backends=$BACKEND -j7
-
-matrix:
- allow_failures:
- - python: pypy
- - python: pypy3
- - python: 3.6-dev
- - python: 3.7-dev
- exclude:
- - python: pypy
- env: BACKEND=cpp
- - python: pypy3
- env: BACKEND=cpp
-
-addons:
- apt:
- packages:
- - gdb
- - python-dbg
- - python3-dbg
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index e243dddb3..043cd7206 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -512,16 +512,25 @@
#define CYTHON_FALLTHROUGH [[fallthrough]]
#elif __has_cpp_attribute(clang::fallthrough)
#define CYTHON_FALLTHROUGH [[clang::fallthrough]]
+ #elif __has_cpp_attribute(gnu::fallthrough)
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
#endif
#endif
#ifndef CYTHON_FALLTHROUGH
- #if (defined(__GNUC__) || defined(__clang__)) && __has_attribute(fallthrough)
+ #if __has_attribute(fallthrough)
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
#else
#define CYTHON_FALLTHROUGH
#endif
#endif
+
+ #if defined(__clang__ ) && defined(__apple_build_version__)
+ #if __apple_build_version__ < 7000000 /* Xcode < 7.0 */
+ #undef CYTHON_FALLTHROUGH
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
#endif
/////////////// CInitCode ///////////////
diff --git a/Demos/embed/Makefile b/Demos/embed/Makefile
index f00697f1a..e8d40b999 100644
--- a/Demos/embed/Makefile
+++ b/Demos/embed/Makefile
@@ -1,6 +1,7 @@
# Makefile for creating our standalone Cython program
PYTHON := python
PYVERSION := $(shell $(PYTHON) -c "import sys; print(sys.version[:3])")
+PYPREFIX := $(shell $(PYTHON) -c "import sys; print(sys.prefix)")
INCDIR := $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_python_inc())")
PLATINCDIR := $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_python_inc(plat_specific=True))")
@@ -31,5 +32,5 @@ clean:
@rm -f *~ *.o *.so core core.* *.c embedded test.output
test: clean all
- LD_LIBRARY_PATH=$(LIBDIR1):$$LD_LIBRARY_PATH ./embedded > test.output
+ PYTHONHOME=$(PYPREFIX) LD_LIBRARY_PATH=$(LIBDIR1):$$LD_LIBRARY_PATH ./embedded > test.output
$(PYTHON) assert_equal.py embedded.output test.output
diff --git a/runtests.py b/runtests.py
index f27383dad..eaac72112 100755
--- a/runtests.py
+++ b/runtests.py
@@ -253,7 +253,6 @@ def update_cpp11_extension(ext):
update cpp11 extensions that will run on versions of gcc >4.8
"""
gcc_version = get_gcc_version(ext.language)
- compiler_version = gcc_version.group(1)
if gcc_version is not None:
compiler_version = gcc_version.group(1)
if float(compiler_version) > 4.8:
@@ -2089,6 +2088,13 @@ def runtests(options, cmd_args, coverage=None):
sys.stderr.write("Backends: %s\n" % ','.join(backends))
languages = backends
+ if 'TRAVIS' in os.environ and sys.platform == 'darwin' and 'cpp' in languages:
+ bugs_file_name = 'travis_macos_cpp_bugs.txt'
+ exclude_selectors += [
+ FileListExcluder(os.path.join(ROOTDIR, bugs_file_name),
+ verbose=verbose_excludes)
+ ]
+
if options.use_common_utility_dir:
common_utility_dir = os.path.join(WORKDIR, 'utility_code')
if not os.path.exists(common_utility_dir):
diff --git a/tests/travis_macos_cpp_bugs.txt b/tests/travis_macos_cpp_bugs.txt
new file mode 100644
index 000000000..17c5d4066
--- /dev/null
+++ b/tests/travis_macos_cpp_bugs.txt
@@ -0,0 +1,9 @@
+complex_numbers_T305
+complex_numbers_c99_T398
+complex_numbers_cpp
+complex_numbers_cxx_T398
+cpdef_extern_func
+cpp_classes_def
+cpp_smart_ptr
+cpp_stl_conversion
+cpp_stl_function