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) {
theta = 0;
} else {
r = -a.real;
theta = atan2{{m}}(0, -1);
theta = atan2{{m}}(0.0, -1.0);
}
} else {
r = __Pyx_c_abs{{func_suffix}}(a);
......
......@@ -7,6 +7,7 @@ environment:
# /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
WITH_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
BACKEND: c
matrix:
- PYTHON: "C:\\Python27"
......@@ -25,6 +26,11 @@ environment:
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"
- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"
BACKEND: cpp
- PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "32"
......@@ -49,6 +55,11 @@ environment:
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "64"
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "64"
BACKEND: cpp
clone_depth: 5
branches:
......@@ -74,7 +85,7 @@ test: off
test_script:
- "%PYTHON%\\Scripts\\pip.exe install -r test-requirements.txt"
- "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:
- path: dist\*
......
......@@ -82,7 +82,7 @@ def test_global():
cdef long long rad(long long x):
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:
rad *= p
while x % p == 0:
......
......@@ -2,8 +2,13 @@
import cython
cdef extern from "complex_int_T446_fix.h":
pass
cdef extern from *:
"""
#if defined _MSC_VER && defined __cplusplus
#define CYTHON_CCOMPLEX 0
#endif
"""
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):
def test_deque_iterator_subtraction(py_v):
"""
>>> test_deque_iterator_subtraction([1, 2, 3])
>>> print(test_deque_iterator_subtraction([1, 2, 3]))
3
"""
cdef deque[int] dint
......@@ -38,7 +38,7 @@ def test_deque_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
"""
cdef vector[int] vint = py_v
......
......@@ -84,10 +84,12 @@ NONMEMBER_BIN_OP2(COMMA)
#define REF_BIN_OP(op) int& operator op (int x) { x++; return value; }
class RefTestOps {
int value = 0;
int value;
public:
RefTestOps() { value = 0; }
REF_UN_OP(-);
REF_UN_OP(+);
REF_UN_OP(*);
......
......@@ -25,3 +25,7 @@ queue
queue2
queue3
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