Merge branch 'more-travis-variance' of https://github.com/psychon/awesome

This commit is contained in:
Uli Schlachter 2016-05-09 18:42:09 +02:00
commit 9d30bf87ae
3 changed files with 25 additions and 14 deletions

View File

@ -5,7 +5,7 @@ env:
matrix: matrix:
- LUA=5.2 LUANAME=lua5.2 BUILD_APIDOC=true DO_COVERAGE=true - LUA=5.2 LUANAME=lua5.2 BUILD_APIDOC=true DO_COVERAGE=true
# Note: luarocks does not work with Lua 5.0. # Note: luarocks does not work with Lua 5.0.
- LUA=5.1 LUANAME=lua5.1 - LUA=5.1 LUANAME=lua5.1 BUILD_IN_DIR=/tmp/awesome-build
# luajit: installed from source. # luajit: installed from source.
- LUA=5.1 LUANAME=luajit-2.0 LUALIBRARY=/usr/lib/libluajit-5.1.so LUAROCKS_ARGS=--lua-suffix=jit-2.0.4 - LUA=5.1 LUANAME=luajit-2.0 LUALIBRARY=/usr/lib/libluajit-5.1.so LUAROCKS_ARGS=--lua-suffix=jit-2.0.4
# Lua 5.2 with older lgi and screen size not divisible by 2. # Lua 5.2 with older lgi and screen size not divisible by 2.
@ -92,6 +92,13 @@ install:
script: script:
- export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -DLUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION" - export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -DLUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION"
- |
if [ -n "$BUILD_IN_DIR" ]; then
SOURCE_DIRECTORY="$PWD"
mkdir "$BUILD_IN_DIR"
cd "$BUILD_IN_DIR"
cmake $CMAKE_ARGS "$SOURCE_DIRECTORY"
fi
- make && sudo env PATH=$PATH make install && awesome --version && make check - make && sudo env PATH=$PATH make install && awesome --version && make check
- | - |
if [ "$DO_COVERAGE" = "true" ]; then if [ "$DO_COVERAGE" = "true" ]; then

View File

@ -361,7 +361,7 @@ endif()
# {{{ Tests # {{{ Tests
set(CHECK_TARGETS check-integration) set(CHECK_TARGETS check-integration)
add_custom_target(check-integration add_custom_target(check-integration
"${CMAKE_SOURCE_DIR}/tests/run.sh" sh -c "CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ${CMAKE_SOURCE_DIR}/tests/run.sh"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Running integration tests" COMMENT "Running integration tests"
VERBATIM) VERBATIM)

View File

@ -17,6 +17,12 @@ if [ "$CI" = true ]; then
set -x set -x
fi fi
source_dir="$PWD"
build_dir="$CMAKE_BINARY_DIR"
if [ -z "$build_dir" ]; then
build_dir="$PWD/build"
fi
# Change to file's dir (POSIXly). # Change to file's dir (POSIXly).
cd -P -- "$(dirname -- "$0")" cd -P -- "$(dirname -- "$0")"
this_dir=$PWD this_dir=$PWD
@ -28,8 +34,6 @@ else
tests=$this_dir/test*.lua tests=$this_dir/test*.lua
fi fi
root_dir=$PWD/..
# Travis. # Travis.
if [ "$CI" = true ]; then if [ "$CI" = true ]; then
HEADLESS=1 HEADLESS=1
@ -44,13 +48,13 @@ export TEST_PAUSE_ON_ERRORS # Used in tests/_runner.lua.
XEPHYR=Xephyr XEPHYR=Xephyr
XVFB=Xvfb XVFB=Xvfb
AWESOME=$root_dir/build/awesome AWESOME=$build_dir/awesome
if ! [ -x "$AWESOME" ]; then if ! [ -x "$AWESOME" ]; then
echo "$AWESOME is not executable." >&2 echo "$AWESOME is not executable." >&2
exit 1 exit 1
fi fi
RC_FILE=$root_dir/build/awesomerc.lua RC_FILE=$build_dir/awesomerc.lua
AWESOME_CLIENT="$root_dir/utils/awesome-client" AWESOME_CLIENT="$source_dir/utils/awesome-client"
D=:5 D=:5
SIZE="${TESTS_SCREEN_SIZE:-1024x768}" SIZE="${TESTS_SCREEN_SIZE:-1024x768}"
@ -71,7 +75,7 @@ else
# ( sleep 1; kill -USR1 $xserver_pid ) & # ( sleep 1; kill -USR1 $xserver_pid ) &
fi fi
cd $root_dir/build cd $build_dir
LUA_PATH="$(lua -e 'print(package.path)');lib/?.lua;lib/?/init.lua" LUA_PATH="$(lua -e 'print(package.path)');lib/?.lua;lib/?/init.lua"
# Add test dir (for _runner.lua). # Add test dir (for _runner.lua).
@ -160,21 +164,21 @@ eval $(DISPLAY="$D" dbus-launch --sh-syntax --exit-with-session)
if [ "$CI" != true ]; then if [ "$CI" != true ]; then
# Prepare a config file pointing to a working theme # Prepare a config file pointing to a working theme
# Handle old filename of config files (useful for git-bisect). # Handle old filename of config files (useful for git-bisect).
if [ -f $root_dir/awesomerc.lua.in ]; then if [ -f $source_dir/awesomerc.lua.in ]; then
SED_IN=.in SED_IN=.in
fi fi
RC_FILE=$tmp_files/awesomerc.lua RC_FILE=$tmp_files/awesomerc.lua
THEME_FILE=$tmp_files/theme.lua THEME_FILE=$tmp_files/theme.lua
sed -e "s:.*beautiful.init(.*default/theme.lua.*:beautiful.init('$THEME_FILE'):" $root_dir/awesomerc.lua$SED_IN > $RC_FILE sed -e "s:.*beautiful.init(.*default/theme.lua.*:beautiful.init('$THEME_FILE'):" $source_dir/awesomerc.lua$SED_IN > $RC_FILE
sed -e "s:@AWESOME_THEMES_PATH@/default/titlebar:$root_dir/build/themes/default/titlebar:" \ sed -e "s:@AWESOME_THEMES_PATH@/default/titlebar:$build_dir/themes/default/titlebar:" \
-e "s:@AWESOME_THEMES_PATH@:$root_dir/themes/:" \ -e "s:@AWESOME_THEMES_PATH@:$source_dir/themes/:" \
-e "s:@AWESOME_ICON_PATH@:$root_dir/icons:" $root_dir/themes/default/theme.lua$SED_IN > $THEME_FILE -e "s:@AWESOME_ICON_PATH@:$source_dir/icons:" $source_dir/themes/default/theme.lua$SED_IN > $THEME_FILE
fi fi
# Start awesome. # Start awesome.
start_awesome() { start_awesome() {
export DISPLAY="$D" export DISPLAY="$D"
cd $root_dir/build cd $build_dir
DISPLAY="$D" "$AWESOME" -c "$RC_FILE" $AWESOME_OPTIONS > $awesome_log 2>&1 & DISPLAY="$D" "$AWESOME" -c "$RC_FILE" $AWESOME_OPTIONS > $awesome_log 2>&1 &
awesome_pid=$! awesome_pid=$!
cd - >/dev/null cd - >/dev/null