Commit 5f9e7d01 authored by peastman's avatar peastman
Browse files

Merge pull request #1289 from rmcgibbo/appveyor-opencl2

Add OpenCL to Appveyor and fix nosetests
parents 4bafde33 8807d7b4
......@@ -131,16 +131,11 @@ script:
make PythonInstall;
fi;
python -m simtk.testInstallation;
(cd python/tests && py.test -v *);
(cd python/tests && py.test -v);
fi
- # run all of the tests, making sure failures at this stage don't cause travis failures
- ctest -j2 --output-on-failure --schedule-random --stop-time $CTEST_STOP_TIME || true
- # get a list of all of the failed tests into this stupid ctest format
- python -c "import os; fn = os.path.join('Testing', 'Temporary', 'LastTestsFailed.log'); os.path.exists(fn) or exit(0); failed = [line.split(':')[0] for line in open(fn)]; print(','.join(x+','+x for x in failed))" > FailedTests.log
- if [ -s Testing/Temporary/LastTestsFailed.log ]; then
ctest -I FailedTests.log;
fi
- python devtools/run-ctest.py -j2 --schedule-random --stop-time $CTEST_STOP_TIME
- if [[ ! -z "${DOCS_DEPLOY}" && "${DOCS_DEPLOY}" = "true" ]]; then
pip install sphinx numpydoc;
make DoxygenApiDocs PythonApiDocs;
......
......@@ -5,11 +5,10 @@ install:
# Setup shell for VS2010, x64, release mode
- >
"%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release
# Set path to python, git-bash tools.
- "set PATH=C:\\Python34-x64;C:\\Python34-x64\\Scripts;%PATH%"
- "set PATH=C:\\Program Files (x86)\\Git\\bin;%PATH%"
- pip install nose
- pip install pytest
# Download FFTW3 for PME plugin
- C:\MinGW\msys\1.0\bin\wget -q ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4-dll64.zip
......@@ -22,26 +21,40 @@ install:
# Download and install some OpenMM build dependencies (doxygen, swig)
- choco install -y doxygen.portable swig > null
# Set CMake options
- ps: $env:CMAKE_FLAGS='-DOPENMM_BUILD_PME_PLUGIN=ON -DFFTW_LIBRARY=C:/fftw/libfftw3f-3.lib -DFFTW_INCLUDES=C:/fftw -DCMAKE_BUILD_TYPE=Release -DOPENMM_BUILD_EXAMPLES=OFF -DCMAKE_CXX_FLAGS_RELEASE="/MD /Od /Ob0 /D NDEBUG"'
# Download OpenCL Headers and build the ICD loader
- ps: $opencl_registry = "https://www.khronos.org/registry/cl"
- ps: mkdir C:/opencl > $null
- ps: cd C:/opencl
- ps: wget $opencl_registry/specs/opencl-icd-1.2.11.0.tgz -OutFile opencl-icd-1.2.11.0.tgz
- ps: 7z x opencl-icd-1.2.11.0.tgz > $null
- ps: 7z x opencl-icd-1.2.11.0.tar > $null
- ps: mv .\icd\* .
- ps: mkdir inc/CL > $null
- ps: wget $opencl_registry/api/1.2/ | select -ExpandProperty links | where {$_.href -like "*.h*"} | select -ExpandProperty outerText | foreach{ wget $opencl_registry/api/1.2/$_ -OutFile inc/CL/$_ }
- ps: mkdir lib > $null
- ps: cd lib
- cmake -G "NMake Makefiles" ..
- nmake
- cd %APPVEYOR_BUILD_FOLDER%
build_script:
- ps: $env:CMAKE_FLAGS =
"-DOPENMM_BUILD_PME_PLUGIN=ON
-DOPENCL_INCLUDE_DIR=C:/opencl/inc
-DOPENCL_LIBRARY=C:/opencl/lib/OpenCL.lib
-DFFTW_LIBRARY=C:/fftw/libfftw3f-3.lib
-DFFTW_INCLUDES=C:/fftw
-DOPENMM_BUILD_EXAMPLES=OFF
-DOPENMM_BUILD_OPENCL_TESTS=OFF
-DCMAKE_BUILD_TYPE=Release
-LA"
- mkdir build
- cd build
- cmake -G "NMake Makefiles" %CMAKE_FLAGS% -LA ..
# Run the build
- cmake -G "NMake Makefiles" %CMAKE_FLAGS% -LA -DCMAKE_CXX_FLAGS_RELEASE="/MD /Od /Ob0 /D NDEBUG" ..
- cmake --build . --target install
- cmake --build . --target PythonInstall
build: false
test_script:
- ctest || exit 0
- python -c "import os; fn = os.path.join('Testing', 'Temporary', 'LastTestsFailed.log'); os.path.exists(fn) or exit(0); failed = [line.split(':')[0] for line in open(fn)]; print(','.join(x+','+x for x in failed))" > FailedTests.log
- ps: >
If (Test-Path "Testing\\Temporary\\LastTestsFailed.log") {
cat Testing\\Temporary\\LastTestsFailed.log
cat FailedTests.log
ctest -I FailedTests.log
}
- python %APPVEYOR_BUILD_FOLDER%\devtools\run-ctest.py
- cd python\tests
- nosetests -vv --processes=-1 --process-timeout=200
- cd %APPVEYOR_BUILD_FOLDER%
- py.test -v
from __future__ import print_function
import sys
from os.path import join, exists
from subprocess import call
def main():
# pass any extra arguments to the first ctest invocation
if call(['ctest', '--output-on-failure'] + sys.argv[1:], shell=True) == 0:
return 0
# load the log file containing the failed tests and reformat
# it in a way so that ctest can take it as input to rerun
# the failing tests
log = join('Testing', 'Temporary', 'LastTestsFailed.log')
assert exists(log)
failed = []
for line in open(log):
failed.append(line.split(':')[0])
with open('FailedTests.log', 'w') as f:
print(','.join(x + ',' + x for x in failed), file=f)
return call(['ctest', '--output-on-failure', '-I', 'FailedTests.log'])
if __name__ == '__main__':
sys.exit(main())
......@@ -51,6 +51,7 @@ foreach(SUBDIR ${SUBDIRS})
"${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}/*README.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}/*.py"
"${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}/*.i"
"${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}/*.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}/*.sh"
"${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}/*.xml"
"${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}/*.pdb"
......
[pytest]
python_files=Test*.py
\ No newline at end of file
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