Skip to content

Commit

Permalink
Configure tests on Travis and AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
dean0x7d committed Jun 11, 2016
1 parent 28381e3 commit b6d1cd6
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '{build}'
image: Visual Studio 2015
platform:
- x86
- x64
environment:
global:
DISTUTILS_USE_SDK: 1
MSSdk: 1
matrix:
- PYTHON: 27
- PYTHON: 35
- CONDA: 27
- CONDA: 35
matrix:
allow_failures:
- platform: x86
CONDA: 27
install:
- cmd: '"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%'
- ps: |
if ($env:PYTHON) {
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
pip install --disable-pip-version-check --user --upgrade pip
} elseif ($env:CONDA) {
if ($env:CONDA -eq "27") { $env:CONDA = "" }
if ($env:PLATFORM -eq "x64") { $env:CONDA = "$env:CONDA-x64" }
$env:PATH = "C:\Miniconda$env:CONDA\;C:\Miniconda$env:CONDA\Scripts\;$env:PATH"
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda update -q conda
conda install -q conda-build
}
build_script:
- ps: |
if ($env:PYTHON) {
python setup.py sdist
pip install --verbose dist\python_example-0.0.1.zip
} elseif ($env:CONDA) {
conda build conda.recipe
conda install --use-local python_example
}
test_script:
- ps: python tests\test.py
51 changes: 51 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
language: cpp
os:
- linux
- osx
env:
- PYTHON=2.7
- PYTHON=3.5
- CONDA=2.7
- CONDA=3.5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- deadsnakes
packages:
- g++-4.8
- python3.5
- python3.5-dev
before_install:
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi
if [ -n "$PYTHON" ]; then
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$PYTHON" = "3.5" ]; then
brew update; brew install python3;
fi
pip install --user --upgrade pip virtualenv
virtualenv -p python$PYTHON venv
source venv/bin/activate
elif [ -n "$CONDA" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then OS=Linux-x86_64; else OS=MacOSX-x86_64; fi
wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda${CONDA:0:1}-latest-$OS.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda update -q conda
conda install -q conda-build
conda create -q -n test-environment python=$CONDA
source activate test-environment
fi
install:
- |
if [ -n "$PYTHON" ]; then
python setup.py sdist
pip install --verbose dist/*.tar.gz
elif [ -n "$CONDA" ]; then
conda build conda.recipe
conda install --use-local python_example
fi
script:
- python tests/test.py
5 changes: 5 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import python_example as m

assert m.__version__ == '0.0.1'
assert m.add(1, 2) == 3
assert m.subtract(1, 2) == -1

0 comments on commit b6d1cd6

Please sign in to comment.