Modify Travis config to add Linux support

This commit is contained in:
mihacooper 2017-01-22 20:01:02 +03:00
parent 7625d338bc
commit b61ef0f7ca
3 changed files with 49 additions and 26 deletions

View File

@ -1,7 +1,45 @@
language: cpp
dist: trusty
matrix:
# Linux / GCC 5.0
include:
- compiler: g++-5
sudo: required
compiler: clang
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- lua5.2
- liblua5.2-dev
before_install:
- sudo apt-get autoremove lua lua5.1
install:
- sudo apt-get install -y gdb
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 30
after_failure:
- COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1) # find core file
- if [[ -f "$COREFILE" ]]; then gdb -c "$COREFILE" ./tests -ex "thread apply all bt" -ex "set pagination 0" -batch; fi
before_script:
- ulimit -c unlimited -S
script:
- mkdir build_dir && cd build_dir
- cmake -DLUA_INCLUDE_DIR="/usr/include/lua5.2" -DLUA_LIBRARY="/usr/lib/x86_64-linux-gnu/liblua5.2.so" ..
- make -j4 all && make install
- ./tests
- cd ../lua-tests/ && ./run_tests.lua
# Mac OS X / Clang 3.8
- compiler: clang
os: osx
osx_image: xcode8.2
script: ./ci.sh
before_install:
- brew update
install:
- brew install lua
script:
- mkdir build_dir && cd build_dir
- cmake .. && make -j4 all && make install
- ./tests
- cd ../lua-tests && ./run_tests.lua

View File

@ -1,11 +1,12 @@
cmake_minimum_required(VERSION 2.8)
project(effil)
if (NOT LUA_INCLUDE_DIR OR NOT LUA_LIBRARY)
find_package(Lua REQUIRED)
if( "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" LESS "5.2")
message(FATAL_ERROR "Wrong Lua version ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}, use 5.2 or higher")
endif()
endif()
include_directories(src src/sol/single/sol ${LUA_INCLUDE_DIR})

16
ci.sh
View File

@ -1,16 +0,0 @@
#!/bin/sh -e
brew update && true
brew install lua cmake && true
ROOT_DIR=$( cd $(dirname $0); pwd )
WORK_DIR=$ROOT_DIR/build
mkdir -p $WORK_DIR
# build
(cd $WORK_DIR && cmake $ROOT_DIR && make -j4 all && make install)
# run tests
(cd $WORK_DIR && ./tests)
(cd $ROOT_DIR/lua-tests && ./run_tests.lua)