Travis fixes (#3)

* Add more rows to travis matrix

Add OS X new image

* Travis build fixes

Use the filesystem and the user’s directory which is already included in PATH

* travis get tests running on new OS X image

The rpath configuration for uv needs libuv.dylib in /usr/local/lib.
It’s easier to static link for tests instead.

* OS X cannot set sigaction on 42

Use 2 (SIGINT) for the test.
This commit is contained in:
Tushar Maheshwari 2016-09-13 18:01:02 +05:30 committed by GitHub
parent dd1a874139
commit b2e17090c3
4 changed files with 53 additions and 25 deletions

View File

@ -1,29 +1,38 @@
language: generic
cache:
apt: true
os:
- linux
matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env: COMPILER=g++-5
- os: osx
osx_image: xcode7.3
before_install:
- mkdir -p ~/.cmake
- export PATH=$HOME/.cmake/cmake-3.6.2-Linux-x86_64/bin:$PATH
- travis_retry curl -s https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.tar.gz | tar -xz -C ~/.cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- gcc-5
- g++-5
- clang-3.8
before_script:
language: cpp
compiler:
- gcc
- clang
before_install: ./travis.sh
install:
- if [ "$CXX" = "g++" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX="g++-5" CC="gcc-5"; fi
- if [ "$CXX" = "clang++" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX="clang++-3.8" CC="clang-3.8"; fi
- echo ${PATH}
- echo ${CXX}
- ${CXX} --version
- ${CXX} -v
- cmake --version
- ./deps.sh
script:
- cd build
- cmake -DCMAKE_CXX_COMPILER=$COMPILER .. && make && make test
before_script: ./deps.sh
script: mkdir -p build && cd build && cmake .. && make && make test

View File

@ -15,10 +15,13 @@ set(
COMMON_LINK_LIBS
${CMAKE_THREAD_LIBS_INIT}
${GOOGLETEST_LIBRARIES}
${UV_LIBRARIES}
${LIBRT_LIBRARIES}
${UV_STATIC_LIBRARY}
)
if(${LIBRT_FOUND})
list(APPEND COMMON_LINK_LIBS ${LIBRT_LIBRARIES})
endif(${LIBRT_FOUND})
add_library(odr OBJECT odr.cpp)
target_include_directories(odr PRIVATE ${COMMON_INCLUDE_DIRS})

View File

@ -10,9 +10,9 @@ TEST(Signal, Fake) {
handle->on<uvw::ErrorEvent>(l);
handle->on<uvw::CheckEvent>(l);
handle->start(42);
handle->start(2);
ASSERT_EQ(42, handle->signal());
ASSERT_EQ(2, handle->signal());
handle->stop();
handle->close();

16
travis.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
USER_PATH_DIR=~/bin
TEMP_DIR=~/.cmake
mkdir -p ${USER_PATH_DIR}
mkdir -p ${TEMP_DIR}
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
curl -s https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.tar.gz | tar -xz -C ${TEMP_DIR}
ln -s ${TEMP_DIR}/cmake-3.6.2-Linux-x86_64/bin/cmake ${USER_PATH_DIR}
fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
curl -s https://cmake.org/files/v3.6/cmake-3.6.2-Darwin-x86_64.tar.gz | tar -xz -C ${TEMP_DIR}
"${TEMP_DIR}/cmake-3.6.2-Darwin-x86_64/CMake.app/Contents/bin/cmake-gui" --install=${USER_PATH_DIR}
fi