-
-
Notifications
You must be signed in to change notification settings - Fork 992
/
.travis.yml
69 lines (64 loc) · 4.17 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
language: cpp
compiler:
- gcc
- clang
env:
- ALTERNATE_CONFIGURATION=true
- ALTERNATE_CONFIGURATION=false
matrix:
exclude:
- compiler: gcc
env: ALTERNATE_CONFIGURATION=true
before_install:
- export TARGETS="wesnoth wesnothd campaignd test"
- export WML_TESTS=true
- export CPP_TESTS=true
- export CHECK_UTF8=true
- export PLAY_TEST=true
- export STRICT_COMPILATION=true
- export EXTRA_FLAGS_RELEASE="-O0"
- export WML_TEST_TIME=40
- if [ "$ALTERNATE_CONFIGURATION" = true ]; then export STRICT_COMPILATION=false; fi
- if [ "$ALTERNATE_CONFIGURATION" = true ]; then export EXTRA_FLAGS_RELEASE=""; fi
- if [ "$ALTERNATE_CONFIGURATION" = true ]; then export WML_TEST_TIME=20; fi
- if [ "$CXX" = "g++" ]; then export WML_TESTS=false; fi
- if [ "$CXX" = "g++" ]; then export PLAY_TEST=false; fi
- if [ "$CXX" = "g++" ]; then export CHECK_UTF8=false; fi
- if [ "$CXX" = "g++" ]; then time sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; fi
install:
- time sudo apt-get update -qq
- time sudo apt-get install -qq libboost-iostreams-dev libboost-program-options-dev libboost-regex-dev libboost-system-dev libboost-test-dev libcairo2-dev libfribidi-dev libpango1.0-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev
- if [ "$CXX" = "g++" ]; then time sudo apt-get install g++-4.8; fi
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8"; fi
- if [ "$WML_TESTS" = true ]; then time sudo apt-get install gdb; fi
# gdb is used to generate a backtrace if a wml test crashes, this is -g option to run_wml_tests. it is also needed when the test executable crashes
- if [ "$CHECK_UTF8" = true ]; then time sudo apt-get install -qq moreutils; fi
# more utils is needed for check_utf8 script
script:
- if [ "$CHECK_UTF8" = true ]; then time ./utils/travis/check_utf8.sh; fi
- time if grep -qorHbm1 "^`echo -ne '\xef\xbb\xbf'`" po/ src/ data/ ; then echo "Error, Found a UTF8 BOM:\n"; grep -orHbm1 "^`echo -ne '\xef\xbb\xbf'`" po/ src/ data/ ; ./utils/travis/exit_wrapper.sh 1; fi
# UTF8 checks are the previous two lines. the second one checks po src data for UTF8 bom, this takes a few seconds.
- scons cxxtool=$CXX --debug=time build=release extra_flags_release="$EXTRA_FLAGS_RELEASE" strict=$STRICT_COMPILATION $TARGETS
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- time if [ "$CPP_TESTS" = true ]; then ./test; export TEST_ERROR_CODE=$?; ./utils/travis/exit_wrapper.sh $TEST_ERROR_CODE; fi
- if [ "$WML_TESTS" = true ]; then time ./run_wml_tests -g -v -t "$WML_TEST_TIME"; fi
- time if [ "$PLAY_TEST" = true ]; then ./wesnoth -m --controller 1:ai --controller 2:ai --nogui; export PLAY_TEST_ERROR_CODE=$?; ./utils/travis/exit_wrapper.sh $PLAY_TEST_ERROR_CODE; fi
after_failure:
- if [[ "$TEST_ERROR_CODE" -ge 128 || "$PLAY_TEST_ERROR_CODE" -ge 128 ]] && [[ "$WML_TESTS" = false ]]; then time sudo apt-get install -qq gdb; fi
# Need to install that if we don't already have it
- if [ -f "errors.log" ]; then echo -e "\n*** \n*\n* Errors reported in wml unit tests, here is errors.log...\n*\n*** \n"; cat errors.log; fi
- if [ "$TEST_ERROR_CODE" -ge 128 ]; then echo -e "\n***\n*\n* Encountered a segfault in the c++ unit test executable, attempting to get a backtrace in the remaining time...\n*\n***\n"; fi
- if [ "$TEST_ERROR_CODE" -ge 128 ]; then time gdb -q -batch -ex start -ex continue -ex bt -ex quit --args ./test; fi
- if [ "$PLAY_TEST_ERROR_CODE" -ge 128 ]; then echo -e "\n***\n*\n* Encountered a segfault when running an ai test, attempting to get a backtrace in the remaining time...\n*\n***\n"; fi
- if [ "$PLAY_TEST_ERROR_CODE" -ge 128 ]; then time gdb -q -batch -ex start -ex continue -ex bt -ex quit --args ./wesnoth -m --controller 1:ai --controller 2:ai --nogui; fi
notifications:
email: false
irc:
channels:
- "chat.freenode.net#wesnoth-dev"
template:
- "\x02%{repository}\x0f#\x0312%{build_number}\x0f (\x0307%{branch}\x0f - \x02%{commit}\x0f : \x0303%{author}\x0f): \x02%{message}\x0f"
- "Build details : \x0302%{build_url}\x0f"
on_success: change
on_failure: always