Commit b5d5caae authored by Laurent Belcour's avatar Laurent Belcour
Browse files

[CI] Ensure that numpy and python3 is installed

parent f0154017
...@@ -7,6 +7,11 @@ build: ...@@ -7,6 +7,11 @@ build:
environment: environment:
matrix: matrix:
- builder: cmake - builder: cmake
PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.3"
PYTHON_ARCH: "64"
PIP: "C:\\Python36-x64\\Scripts\\pip"
- builder: scons - builder: scons
init: init:
...@@ -14,11 +19,13 @@ init: ...@@ -14,11 +19,13 @@ init:
install: install:
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- python --version - if "%builder%" == "scons" (
- python -m ensurepip python --version &
- pip install -U setuptools python -m ensurepip &
- pip install -U wheel pip install -U setuptools &
- pip install scons==2.4.1 pip install -U wheel &
pip install scons==2.4.1
)
- cinst nsis.portable - cinst nsis.portable
- hg clone https://bitbucket.org/eigen/eigen external\eigen3 - hg clone https://bitbucket.org/eigen/eigen external\eigen3
- cd external\eigen3 - cd external\eigen3
...@@ -95,7 +102,7 @@ test_script: ...@@ -95,7 +102,7 @@ test_script:
- if "%builder%" == "scons" ( - if "%builder%" == "scons" (
scons --cfg=./configs/scons/config-windows-appveyor.py tests scons --cfg=./configs/scons/config-windows-appveyor.py tests
appveoyr PushArtifact build\sources\tests\*.log appveoyr PushArtifact build\sources\tests\*.log
) else ) else (
cd build & cd build &
nmake test & nmake test &
appveyor PushArtifact Testing\Temporary\LastTest.log & appveyor PushArtifact Testing\Temporary\LastTest.log &
......
...@@ -17,6 +17,7 @@ addons: ...@@ -17,6 +17,7 @@ addons:
- cmake - cmake
- libeigen3-dev - libeigen3-dev
- libpython3-dev - libpython3-dev
- python3-numpy
before_install: before_install:
- OMP_NUM_THREADS=2 - OMP_NUM_THREADS=2
......
import alta import alta
import numpy
fail = 0 fail = 0
...@@ -35,17 +34,36 @@ for i in range(0,len(y)): ...@@ -35,17 +34,36 @@ for i in range(0,len(y)):
if l[i] != y[i]: if l[i] != y[i]:
fail += 1 fail += 1
# Print the test result
if fail > 0:
print("Testing python 'vec' interface failed!")
exit(1)
else:
print("Testing python 'vec' interface passed!")
exit(0)
###########################################################
## ##
## SPECIAL TEST: Interoperability with the numpy library ##
## ##
###########################################################
fail = 0
import numpy
# Conversion to a numpy array # Conversion to a numpy array
na = numpy.array(y) na = numpy.array(y)
for i in range(0,len(y)): for i in range(0,len(y)):
if na[i] != y[i]: if na[i] != y[i]:
fail += 1 fail += 1
# Print the test result # Print the test result
if fail > 0: if fail > 0:
print("Testing python 'vec' interface failed!") print("Testing python 'vec' interface with 'numpy' failed!")
exit(1) exit(1)
else: else:
print("Testing python 'vec' interface passed!") print("Testing python 'vec' interface with 'numpy' passed!")
exit(0) exit(0)
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