Commit 96403849 authored by Stefan Behnel's avatar Stefan Behnel Committed by GitHub

Merge pull request #2797 from cython/msvc_cpp

Enable C++ tests in appveyor, only for Py2.7/3.7 64 bit for now.
parents 3f35bed0 89321fd4
...@@ -275,7 +275,7 @@ static {{type}} __Pyx_PyComplex_As_{{type_name}}(PyObject* o) { ...@@ -275,7 +275,7 @@ static {{type}} __Pyx_PyComplex_As_{{type_name}}(PyObject* o) {
theta = 0; theta = 0;
} else { } else {
r = -a.real; r = -a.real;
theta = atan2{{m}}(0, -1); theta = atan2{{m}}(0.0, -1.0);
} }
} else { } else {
r = __Pyx_c_abs{{func_suffix}}(a); r = __Pyx_c_abs{{func_suffix}}(a);
......
...@@ -7,6 +7,7 @@ environment: ...@@ -7,6 +7,7 @@ environment:
# /E:ON and /V:ON options are not enabled in the batch script interpreter # /E:ON and /V:ON options are not enabled in the batch script interpreter
# See: https://stackoverflow.com/questions/11267463/compiling-python-modules-on-windows-x64/13751649#13751649 # See: https://stackoverflow.com/questions/11267463/compiling-python-modules-on-windows-x64/13751649#13751649
WITH_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd" WITH_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
BACKEND: c
matrix: matrix:
- PYTHON: "C:\\Python27" - PYTHON: "C:\\Python27"
...@@ -25,6 +26,11 @@ environment: ...@@ -25,6 +26,11 @@ environment:
PYTHON_VERSION: "3.7" PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64" PYTHON_ARCH: "64"
- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"
BACKEND: cpp
- PYTHON: "C:\\Python36" - PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6" PYTHON_VERSION: "3.6"
PYTHON_ARCH: "32" PYTHON_ARCH: "32"
...@@ -49,6 +55,11 @@ environment: ...@@ -49,6 +55,11 @@ environment:
PYTHON_VERSION: "3.4" PYTHON_VERSION: "3.4"
PYTHON_ARCH: "64" PYTHON_ARCH: "64"
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "64"
BACKEND: cpp
clone_depth: 5 clone_depth: 5
branches: branches:
...@@ -74,7 +85,7 @@ test: off ...@@ -74,7 +85,7 @@ test: off
test_script: test_script:
- "%PYTHON%\\Scripts\\pip.exe install -r test-requirements.txt" - "%PYTHON%\\Scripts\\pip.exe install -r test-requirements.txt"
- "set CFLAGS=/Od /W3" - "set CFLAGS=/Od /W3"
- "%WITH_ENV% %PYTHON%\\python.exe runtests.py -vv --no-cpp --no-code-style -j5" - "%WITH_ENV% %PYTHON%\\python.exe runtests.py -vv --backend=%BACKEND% --no-code-style -j5"
artifacts: artifacts:
- path: dist\* - path: dist\*
......
...@@ -82,7 +82,7 @@ def test_global(): ...@@ -82,7 +82,7 @@ def test_global():
cdef long long rad(long long x): cdef long long rad(long long x):
cdef long long rad = 1 cdef long long rad = 1
for p in range(2, <long long>sqrt(x) + 1): for p in range(2, <long long>sqrt(<double>x) + 1): # MSVC++ fails without the input cast
if x % p == 0: if x % p == 0:
rad *= p rad *= p
while x % p == 0: while x % p == 0:
......
...@@ -2,8 +2,13 @@ ...@@ -2,8 +2,13 @@
import cython import cython
cdef extern from "complex_int_T446_fix.h": cdef extern from *:
pass """
#if defined _MSC_VER && defined __cplusplus
#define CYTHON_CCOMPLEX 0
#endif
"""
def test_arith(int complex a, int complex b): def test_arith(int complex a, int complex b):
""" """
......
#if defined _MSC_VER && defined __cplusplus
#define CYTHON_CCOMPLEX 0
#endif
...@@ -25,7 +25,7 @@ def test_vector(py_v): ...@@ -25,7 +25,7 @@ def test_vector(py_v):
def test_deque_iterator_subtraction(py_v): def test_deque_iterator_subtraction(py_v):
""" """
>>> test_deque_iterator_subtraction([1, 2, 3]) >>> print(test_deque_iterator_subtraction([1, 2, 3]))
3 3
""" """
cdef deque[int] dint cdef deque[int] dint
...@@ -38,7 +38,7 @@ def test_deque_iterator_subtraction(py_v): ...@@ -38,7 +38,7 @@ def test_deque_iterator_subtraction(py_v):
def test_vector_iterator_subtraction(py_v): def test_vector_iterator_subtraction(py_v):
""" """
>>> test_vector_iterator_subtraction([1, 2, 3]) >>> print(test_vector_iterator_subtraction([1, 2, 3]))
3 3
""" """
cdef vector[int] vint = py_v cdef vector[int] vint = py_v
......
...@@ -84,10 +84,12 @@ NONMEMBER_BIN_OP2(COMMA) ...@@ -84,10 +84,12 @@ NONMEMBER_BIN_OP2(COMMA)
#define REF_BIN_OP(op) int& operator op (int x) { x++; return value; } #define REF_BIN_OP(op) int& operator op (int x) { x++; return value; }
class RefTestOps { class RefTestOps {
int value = 0; int value;
public: public:
RefTestOps() { value = 0; }
REF_UN_OP(-); REF_UN_OP(-);
REF_UN_OP(+); REF_UN_OP(+);
REF_UN_OP(*); REF_UN_OP(*);
......
...@@ -25,3 +25,7 @@ queue ...@@ -25,3 +25,7 @@ queue
queue2 queue2
queue3 queue3
lunch lunch
# "C linkage function cannot return C++ class" (uses public C++ cdef function)
cpp_template_subclasses
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment