Add 'check' target which both builds and tests

This commit is contained in:
Dean Moldovan 2016-06-01 23:28:44 +02:00
parent 1fe5901062
commit 52ae7b1d33
3 changed files with 8 additions and 10 deletions

View File

@ -19,8 +19,6 @@ install:
build_script: build_script:
- echo Running cmake... - echo Running cmake...
- cd c:\projects\pybind11 - cd c:\projects\pybind11
- cmake -G "%CMAKE_PLATFORM%" -DPYTHON_INCLUDE_DIR:PATH=%PYTHON_DIR%/include -DPYTHON_LIBRARY:FILEPATH=%PYTHON_DIR%/libs/python34.lib -DPYTHON_EXECUTABLE:FILEPATH=%PYTHON_DIR%/python.exe - cmake -G "%CMAKE_PLATFORM%" -DPYTHON_EXECUTABLE:FILEPATH=%PYTHON_DIR%/python.exe
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- set MSBuildOptions=/v:m /p:Configuration=%Configuration% /logger:%MSBuildLogger% - cmake --build . --config %Configuration% --target check -- /v:m /logger:%MSBuildLogger%
- msbuild %MSBuildOptions% pybind11.sln
- ctest -C %Configuration%

View File

@ -23,19 +23,18 @@ matrix:
include: include:
- os: linux - os: linux
compiler: gcc-4.8 compiler: gcc-4.8
script: install:
- pyvenv-3.5 venv - pyvenv-3.5 venv
- cmake -DPYBIND11_PYTHON_VERSION=3.5 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.5m -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.5m.so -DPYTHON_EXECUTABLE:FILEPATH=`pwd`/venv/bin/python3.5 -DCMAKE_CXX_COMPILER=g++-4.8
- make -j 2
- source venv/bin/activate - source venv/bin/activate
- pip install numpy - pip install numpy
- CTEST_OUTPUT_ON_FAILURE=TRUE make test script:
- CXX=g++-4.8 cmake -DPYBIND11_PYTHON_VERSION=3.5
- CTEST_OUTPUT_ON_FAILURE=TRUE make check -j 2
- os: osx - os: osx
compiler: clang compiler: clang
script: script:
- cmake -DPYBIND11_PYTHON_VERSION=2.7 - cmake -DPYBIND11_PYTHON_VERSION=2.7
- make -j 2 - CTEST_OUTPUT_ON_FAILURE=TRUE make check -j 2
- CTEST_OUTPUT_ON_FAILURE=TRUE make test
#- os: linux #- os: linux
#compiler: gcc-4.8 #compiler: gcc-4.8
#script: #script:

View File

@ -145,6 +145,7 @@ endfunction()
if (PYBIND11_TEST) if (PYBIND11_TEST)
enable_testing() enable_testing()
add_subdirectory(example) add_subdirectory(example)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> DEPENDS example)
endif() endif()
if (PYBIND11_INSTALL) if (PYBIND11_INSTALL)