Run unit tests on Travis

This commit is contained in:
Paul Romano 2017-10-13 16:21:34 -05:00
parent d21d158a5b
commit 00f6bbe266
3 changed files with 18 additions and 10 deletions

View file

@ -41,7 +41,7 @@ before_install:
- conda update -q conda
- conda info -a
- if [[ $OPENMC_CONFIG != "check_source" ]]; then
conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION six numpy scipy h5py=2.5 pandas;
conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pip numpy cython;
source activate test-environment;
sudo add-apt-repository ppa:nschloe/hdf5-backports -y;
sudo apt-get update -q;
@ -52,7 +52,8 @@ before_install:
export HDF5_DIR=/usr;
fi
install: true
install:
- pip install -e .[test]
before_script:
- if [[ $OPENMC_CONFIG != "check_source" ]]; then
@ -73,4 +74,5 @@ script:
else
./run_tests.py -C $OPENMC_CONFIG -j 2;
fi
- pytest unit_tests/
- cd ..

View file

@ -468,6 +468,11 @@ file(GLOB_RECURSE TESTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_*.py)
# Loop through all the tests
foreach(test ${TESTS})
# Remove unit tests
if(test MATCHES ".*unit_tests.*")
continue()
endif()
# Get test information
get_filename_component(TEST_NAME ${test} NAME)
get_filename_component(TEST_PATH ${test} PATH)

View file

@ -4,7 +4,7 @@ import glob
import sys
import numpy as np
from setuptools import setup
from setuptools import setup, find_packages
try:
from Cython.Build import cythonize
have_cython = True
@ -36,9 +36,9 @@ kwargs = {
},
# Metadata
'author': 'Will Boyd',
'author_email': 'wbinventor@gmail.com',
'description': 'OpenMC Python API',
'author': 'The OpenMC Development Team',
'author_email': 'openmc-dev@googlegroups.com',
'description': 'OpenMC',
'url': 'https://github.com/mit-crpg/openmc',
'classifiers': [
'Development Status :: 4 - Beta',
@ -59,13 +59,14 @@ kwargs = {
],
# Required dependencies
'install_requires': ['six', 'numpy>=1.9', 'h5py', 'scipy',
'pandas>=0.17.0', 'lxml'],
'install_requires': [
'six', 'numpy>=1.9', 'h5py', 'scipy', 'ipython', 'matplotlib',
'pandas>=0.17.0', 'lxml', 'uncertainties'
],
# Optional dependencies
'extras_require': {
'decay': ['uncertainties'],
'plot': ['matplotlib', 'ipython'],
'test': ['pytest'],
'vtk': ['vtk', 'silomesh'],
},
}