mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
Travis update
The new container-based format doesn't do sudo anymore, so there are some extensive changes. It does, however, allow cache. I also took the opportunity to switch to a newer busted. The root element for that now needs to be a table.
This commit is contained in:
2
.busted
2
.busted
@@ -1,7 +1,7 @@
|
||||
return {
|
||||
default = {
|
||||
verbose = true,
|
||||
ROOT = "spec/front/unit",
|
||||
ROOT = {"spec/front/unit"},
|
||||
lpath = "spec/front/unit/?.lua",
|
||||
},
|
||||
}
|
||||
|
||||
62
.travis.yml
62
.travis.yml
@@ -3,34 +3,64 @@
|
||||
|
||||
language: c
|
||||
|
||||
sudo: false
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
|
||||
env:
|
||||
- EMULATE_READER=1 USE_NO_CCACHE=1
|
||||
- EMULATE_READER=1
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.ccache
|
||||
# - base
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.8
|
||||
- libsdl1.2-dev
|
||||
- luarocks
|
||||
# for luasec
|
||||
- libssl1.0.0
|
||||
- nasm
|
||||
# OpenSSL likes this (package contains makedepend)
|
||||
- xutils-dev
|
||||
|
||||
before_install:
|
||||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq g++-4.8
|
||||
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
|
||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
|
||||
# don't do this for clang
|
||||
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
|
||||
# in case anything ignores the environment variables, override through PATH
|
||||
- mkdir bin
|
||||
- ln -s $(which gcc-4.8) bin/cc
|
||||
- ln -s $(which gcc-4.8) bin/gcc
|
||||
- ln -s $(which c++-4.8) bin/c++
|
||||
- ln -s $(which g++-4.8) bin/g++
|
||||
- export PATH=$PWD/bin:$PATH
|
||||
|
||||
install:
|
||||
# nasm for building libpng
|
||||
- sudo apt-get install libsdl1.2-dev luarocks nasm
|
||||
# install an older version of lua_cliargs for busted v1.10.0
|
||||
- sudo luarocks install lua_cliargs 2.1-2
|
||||
# recent versions of busted may cause some weird segmentation faults
|
||||
- mkdir $HOME/.luarocks
|
||||
- cp /etc/luarocks/config.lua $HOME/.luarocks/config.lua
|
||||
- echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua
|
||||
- travis_retry luarocks --local install lua_cliargs
|
||||
# versions older than 1.10ish and <2.0.rc10-0ish of busted may cause some weird segmentation faults
|
||||
- travis_retry git clone https://github.com/Olivine-Labs/busted/
|
||||
- cd busted && git checkout v1.10.0 && sudo luarocks make && cd ..
|
||||
- travis_retry sudo luarocks install luacov
|
||||
- travis_retry sudo luarocks install luacov-coveralls --server=http://rocks.moonscript.org/dev
|
||||
- cd busted && git checkout v2.0.rc10-0 && luarocks --local make busted-2.0.rc10-0.rockspec && cd ..
|
||||
- travis_retry luarocks --local install luacov
|
||||
# luasec doesn't automatically detect 64-bit libs
|
||||
- travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu
|
||||
- travis_retry luarocks --local install luacov-coveralls --server=http://rocks.moonscript.org/dev
|
||||
# add local rocks to $PATH
|
||||
# on newer luarocks, `luarocks path --bin` would suffice because it includes the PATH now
|
||||
- eval $(luarocks path --bin)
|
||||
- export PATH=$PATH:$HOME/.luarocks/bin
|
||||
|
||||
script:
|
||||
- travis_retry make fetchthirdparty all
|
||||
- sudo cp base/build/*/luajit /usr/bin/
|
||||
- make testfront
|
||||
- travis_retry make testfront
|
||||
|
||||
after_success:
|
||||
- make coverage
|
||||
|
||||
4
Makefile
4
Makefile
@@ -93,14 +93,14 @@ $(INSTALL_DIR)/koreader/.luacov:
|
||||
ln -sf ../../.luacov $(INSTALL_DIR)/koreader
|
||||
|
||||
testfront: $(INSTALL_DIR)/koreader/.busted
|
||||
cd $(INSTALL_DIR)/koreader && busted -l ./luajit --exclude-tags=notest
|
||||
cd $(INSTALL_DIR)/koreader && ./luajit $(shell which busted) --exclude-tags=notest
|
||||
|
||||
test:
|
||||
$(MAKE) -C $(KOR_BASE) test
|
||||
$(MAKE) testfront
|
||||
|
||||
coverage: $(INSTALL_DIR)/koreader/.luacov
|
||||
cd $(INSTALL_DIR)/koreader && busted -c -l ./luajit --exclude-tags=nocov
|
||||
cd $(INSTALL_DIR)/koreader && ./luajit $(shell which busted) --coverage --exclude-tags=nocov
|
||||
# coverage report summary
|
||||
cd $(INSTALL_DIR)/koreader && tail -n \
|
||||
+$$(($$(grep -nm1 Summary luacov.report.out|cut -d: -f1)-1)) \
|
||||
|
||||
Reference in New Issue
Block a user