Merge pull request #1791 from houqp/houqp-master

build: more travis build fix
pull/1793/head
Huang Xin 8 years ago
commit 9020b2e717

@ -45,15 +45,15 @@ install:
- git clone https://github.com/torch/luajit-rocks.git - git clone https://github.com/torch/luajit-rocks.git
- pushd luajit-rocks - pushd luajit-rocks
- git checkout 6529891 - git checkout 6529891
- cmake . -DWITH_LUA52=ON -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/install - cmake . -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/install
- make install - make install
- popd - popd
- export PATH=$PATH:${TRAVIS_BUILD_DIR}/install/bin - export PATH=$PATH:${TRAVIS_BUILD_DIR}/install/bin
- mkdir $HOME/.luarocks - mkdir $HOME/.luarocks
- cp ${TRAVIS_BUILD_DIR}/install/etc/luarocks/config.lua $HOME/.luarocks/config.lua - cp ${TRAVIS_BUILD_DIR}/install/etc/luarocks/config.lua $HOME/.luarocks/config.lua
- echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua - echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua
- travis_retry luarocks --local install ansicolors
- travis_retry luarocks --local install luafilesystem - travis_retry luarocks --local install luafilesystem
- travis_retry luarocks --local install ansicolors
- travis_retry luarocks --local install busted 2.0.rc11-0 - travis_retry luarocks --local install busted 2.0.rc11-0
#- travis_retry luarocks --local install busted 1.11.1-1 #- travis_retry luarocks --local install busted 1.11.1-1
#- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted #- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted
@ -62,14 +62,12 @@ install:
- travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu - 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 - travis_retry luarocks --local install luacov-coveralls --server=http://rocks.moonscript.org/dev
# add local rocks to $PATH # add local rocks to $PATH
# on newer luarocks, `luarocks path --bin` would suffice because it includes the PATH now
- luarocks path --bin
- eval $(luarocks path --bin) - eval $(luarocks path --bin)
script: script:
- travis_retry make fetchthirdparty - travis_retry make fetchthirdparty
- make all - make all
- make testfront - travis_retry make testfront
after_success: after_success:
- make coverage - make coverage

51
kodev

@ -2,6 +2,15 @@
CURDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CURDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function assert_return_zero {
if [ $1 -ne 0 ]; then
if [ ! -z $2 ]; then
echo $2
fi
exit 1
fi
}
function setup_env { function setup_env {
files=("./koreader-emulator-*/koreader") files=("./koreader-emulator-*/koreader")
export EMU_DIR=${files[0]} export EMU_DIR=${files[0]}
@ -36,33 +45,43 @@ ${SUPPORTED_TARGETS}"
;; ;;
kindle) kindle)
make TARGET=kindle make TARGET=kindle
assert_return_zero $?
;; ;;
kobo) kobo)
make TARGET=kobo make TARGET=kobo
assert_return_zero $?
;; ;;
kindle-legacy) kindle-legacy)
make TARGET=kindle-legacy make TARGET=kindle-legacy
assert_return_zero $?
;; ;;
android) android)
if [ ! -d ${CURDIR}/base/toolchain/android-toolchain ]; then if [ ! -d ${CURDIR}/base/toolchain/android-toolchain ]; then
make android-toolchain make android-toolchain
assert_return_zero $?
fi fi
make TARGET=android make TARGET=android
assert_return_zero $?
;; ;;
pocketbook) pocketbook)
if [ ! -d ${CURDIR}/base/toolchain/pocketbook-toolchain ]; then if [ ! -d ${CURDIR}/base/toolchain/pocketbook-toolchain ]; then
make pocketbook-toolchain make pocketbook-toolchain
assert_return_zero $?
fi fi
make TARGET=pocketbook make TARGET=pocketbook
assert_return_zero $?
;; ;;
ubuntu-touch) ubuntu-touch)
make TARGET=ubuntu-touch make TARGET=ubuntu-touch
assert_return_zero $?
;; ;;
win32) win32)
make TARGET=win32 make TARGET=win32
assert_return_zero $?
;; ;;
*) *)
make make
assert_return_zero $? "Failed to build emulator!"
setup_env setup_env
;; ;;
esac esac
@ -225,6 +244,34 @@ OPTIONS:
popd popd
} }
function kodev-test {
TEST_HELP_MSG="
usage: test [front|base] <TEST_NAME>
TEST_NAME is optional. If no TEST_NAME is given, all tests will be run.
"
if [ $# -lt 1 ]; then
echo "${TEST_HELP_MSG}"
exit 1
fi
setup_env
make ${EMU_DIR}/.busted
pushd ${EMU_DIR}
test_path=./spec/$1/unit
if [ ! -z $2 ]; then
test_path="${test_path}/$2"
fi
busted --exclude-tags=notest ${test_path}
popd
}
HELP_MSG=" HELP_MSG="
usage: $0 COMMAND <ARGS> usage: $0 COMMAND <ARGS>
@ -265,6 +312,10 @@ case $1 in
shift 1 shift 1
kodev-run $@ kodev-run $@
;; ;;
test)
shift 1
kodev-test $@
;;
--help | -h) --help | -h)
echo "${HELP_MSG}" echo "${HELP_MSG}"
exit 0 exit 0

Loading…
Cancel
Save