Skip to content

Commit 6addb09

Browse files
authored
More tests and some rearrangements (#363)
* Rearranged tests. Any tests which is in alpha has been moved to tests/alpha directory. To run these tests, use configuration Devel with ctest. * Added this script in regression tests. Seems to be passing #239 Reopen it if this is not a fix. * Issue #47 is WONTFIX. * Refactoring script related to #93 . * Fixed return statement outside function error. So silly! * bumped xcode version to 10.2 * On OSX, use python3 only. * Fix #364 . * Fixed boost include paths. * Reverting xcode to default on travis. * Also test with xcode image 10.2 but allow failure. Removed insource odeint library since centos7 has the required version of boost. CentOS6 is EOL. * moose.test() is python3 compatible. 10.2 seems to be buggy on travis. making failure non-strict on it. Must build with xcode9.4 Added xcode10.2 image.
1 parent 1b38d64 commit 6addb09

File tree

188 files changed

+135
-28116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+135
-28116
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ matrix:
66
- os : linux
77
dist: xenial
88
- os : osx
9-
osx_image: xcode10.1
9+
- osx_image: xcode9.4
10+
- osx_image: xcode10.2
11+
allow_failures:
12+
- os: osx
13+
- osx_image: xcode10.2
1014

1115
notifications:
1216
email:

.travis/travis_build_osx.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,26 @@ set -e
2626
# Make sure not to pick up python from /opt.
2727
PATH=/usr/local/bin:/usr/bin:$PATH
2828

29+
PYTHON3=$(which python3)
30+
2931
# Get pylint
30-
python -m pip install pylint --user
31-
python -m pip install python-libsbml --user
32-
python -m pip install pyneuroml --user
32+
$PYTHON3 -m pip install pylint --user
33+
$PYTHON3 -m pip install python-libsbml --user
34+
$PYTHON3 -m pip install pyneuroml --user
3335

3436
mkdir -p _GSL_BUILD && cd _GSL_BUILD \
3537
&& cmake -DDEBUG=ON \
36-
-DPYTHON_EXECUTABLE=`which python` ..
38+
-DPYTHON_EXECUTABLE=$PYTHON3 \
39+
..
3740
make pylint -j3
38-
make && ctest --output-on-failure -E ".*socket_streamer.*"
41+
make && ctest --output-on-failure
3942

4043
cd .. # Now with boost.
4144
mkdir -p _BOOST_BUILD && cd _BOOST_BUILD \
4245
&& cmake -DWITH_BOOST_ODE=ON -DDEBUG=ON \
43-
-DPYTHON_EXECUTABLE=`which python` ..
46+
-DPYTHON_EXECUTABLE=`which python3` ..
4447

45-
make && ctest --output-on-failure -E ".*socket_streamer.*"
48+
make -j4 && ctest --output-on-failure
4649
cd ..
4750
set +e
4851

.travis/travis_prepare_osx.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,20 @@ brew install python
2828
brew install numpy
2929
brew install boost
3030

31+
PYTHON3=$(which python3)
32+
3133
#brew outdated python || brew install python
3234
#brew outdated numpy || brew install homebrew/python/numpy
3335
brew unlink numpy && brew link numpy || echo "Failed to link numpy"
3436
# Numpy caveats
35-
mkdir -p $HOME/Library/Python/2.7/lib/python/site-packages
36-
echo 'import sys; sys.path.insert(1, "/usr/local/lib/python2.7/site-packages")' >> $HOME/Library/Python/2.7/lib/python/site-packages/homebrew.pth
37+
#mkdir -p $HOME/Library/Python/2.7/lib/python/site-packages
38+
#echo 'import sys; sys.path.insert(1, "/usr/local/lib/python2.7/site-packages")' >> $HOME/Library/Python/2.7/lib/python/site-packages/homebrew.pth
3739

3840
# To make sure that we do not pick python from /opt etc.
3941
PATH=/usr/local/bin:/usr/bin:$PATH
4042
# ensurepip
41-
python -m ensurepip
42-
python -m pip install matplotlib --user --upgrade
43-
python -m pip install pyNeuroML libNeuroML --user
44-
python -m pip install scipy --user
43+
$PYTHON3 -m ensurepip
44+
$PYTHON3 -m pip install matplotlib --user --upgrade
45+
$PYTHON3 -m pip install pyNeuroML libNeuroML --user
46+
$PYTHON3 -m pip install scipy --user
47+
$PYTHON3 -m pip install pylint --user

CMakeLists.txt

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,10 @@ set(STATIC_LIBRARIES "" )
143143
set(SYSTEM_SHARED_LIBS ${LibXML2_LIBRARIES})
144144

145145
# BOOST ode library performs better than GSL and ideally should be made default.
146-
# Making boost default means that we get rid of gsl. Boost does not have a very
147-
# good matrix library; it has ublas which is not well maintained and emit a lot
146+
# Unfortunately Boost does not have a very good matrix library; it has ublas
147+
# which is not well maintained and emit a lot
148148
# of warning during compilation. Nonetheless, WITH_BOOST_ODE works fine and
149-
# produce results quicker than GSL. Both boost ode and ublas are in moose source
150-
# tree ./external/odeint-v2 and ./external/boost-numeric-bindings
149+
# produce results quicker than GSL.
151150
if(WITH_GSL)
152151
find_package(GSL 1.16 REQUIRED)
153152
if(NOT GSL_FOUND)
@@ -172,13 +171,14 @@ if(WITH_GSL)
172171
# top level.
173172
include_directories( ${GSL_INCLUDE_DIRS} )
174173
elseif(WITH_BOOST_ODE)
175-
find_package(Boost 1.44 REQUIRED)
176-
find_package( LAPACK REQUIRED )
174+
find_package(Boost 1.53 REQUIRED)
175+
find_package(LAPACK REQUIRED)
177176
endif()
178177

179178
# if boost ode is being used, don't use GSL.
180179
if(WITH_BOOST_ODE)
181180
add_definitions(-DUSE_BOOST_ODE -UUSE_GSL)
181+
include_directories(${Boost_INCLUDE_DIRS})
182182
endif()
183183

184184
# Openmpi
@@ -441,6 +441,7 @@ set(PYMOOSE_TEST_DIRECTORY ${CMAKE_SOURCE_DIR}/tests/python)
441441
# Collect all python script in tests folder and run them.
442442
file(GLOB PY_TEST_SCRIPTS "${PYMOOSE_TEST_DIRECTORY}/test_*.py" )
443443

444+
444445
# Run python tests.
445446
foreach( _test_script ${PY_TEST_SCRIPTS} )
446447
get_filename_component( _test_name ${_test_script} NAME_WE)
@@ -453,6 +454,36 @@ foreach( _test_script ${PY_TEST_SCRIPTS} )
453454
)
454455
endforeach( )
455456

457+
# Alpha tests. These should not run by default.
458+
set(MOOSE_ALPHA_TEST_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/alpha)
459+
file(GLOB PY_ALPHA_TEST_SCRIPTS "${PYMOOSE_ALPHA_TEST_DIRECTORY}/*.py" )
460+
foreach( _test_script ${PY_ALPHA_TEST_SCRIPTS} )
461+
get_filename_component( _test_name ${_test_script} NAME_WE)
462+
add_test( NAME ${_test_name}
463+
COMMAND ${PYTHON_EXECUTABLE} ${_test_script}
464+
CONFIGURATIONS Devel
465+
WORKING_DIRECTORY ${PYMOOSE_ALPHA_TEST_DIRECTORY}
466+
)
467+
set_tests_properties( ${_test_name}
468+
PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/python"
469+
)
470+
endforeach( )
471+
472+
# Regression and github issues. These should not run by default.
473+
set(PYMOOSE_ISSUES_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/issues)
474+
file(GLOB PY_ISSUES_SCRIPTS "${PYMOOSE_ISSUES_DIRECTORY}/*.py" )
475+
foreach( _test_script ${PY_ISSUES_SCRIPTS} )
476+
get_filename_component( _test_name ${_test_script} NAME_WE)
477+
add_test( NAME ${_test_name}
478+
COMMAND ${PYTHON_EXECUTABLE} ${_test_script}
479+
CONFIGURATIONS Devel
480+
WORKING_DIRECTORY ${PYMOOSE_ISSUES_DIRECTORY}
481+
)
482+
set_tests_properties( ${_test_name}
483+
PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/python"
484+
)
485+
endforeach( )
486+
456487
# add pylint target.
457488
set(PYSCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/python )
458489
file(GLOB_RECURSE PY_SCRIPTS "python/*.py")
@@ -476,4 +507,5 @@ foreach( _py_script ${PY_SCRIPTS} )
476507
endforeach( )
477508

478509
############################ CPACK ######################################
510+
# This is not maintained anymore since packaging is done using OpenBuildService
479511
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake_moose_cpack.cmake)

diffusion/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
cmake_minimum_required(VERSION 2.8)
22
include( ${CMAKE_CURRENT_SOURCE_DIR}/../CheckCXXCompiler.cmake)
3-
include_directories(${GSL_INCLUDE_DIRS})
3+
4+
if(WITH_GSL)
5+
include_directories(${GSL_INCLUDE_DIRS})
6+
endif(WITH_GSL)
7+
48
add_library(diffusion
59
FastMatrixElim.cpp
610
DiffPoolVec.cpp

external/odeint-v2/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

external/odeint-v2/fix-copyright.py

Lines changed: 0 additions & 73 deletions
This file was deleted.

external/odeint-v2/include/boost/numeric/odeint.hpp

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)