From 3ea3be5bcb0d57fc2d1ca473f51162a5ed6ec54c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Dec 2015 15:07:28 +0100 Subject: [PATCH 1/5] Make Travis logs more readable by folding the different sections See https://github.com/travis-ci/travis-ci/issues/2285 for more information about log folding on Travis. --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1e213d66c7..271c74a676 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,12 +30,24 @@ env: - wxCONFIGURE_FLAGS="--enable-stl" CXXFLAGS=-std=c++0x script: + - echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r' - ./configure --disable-optimise $wxCONFIGURE_FLAGS + - echo -en 'travis_fold:end:script.1\\r' + - echo 'Building...' && echo -en 'travis_fold:start:script.2\\r' - make + - echo -en 'travis_fold:end:script.2\\r' + - echo 'Testing...' && echo -en 'travis_fold:start:script.3\\r' - make -C tests - pushd tests - ./test -t - popd + - echo -en 'travis_fold:end:script.3\\r' + - echo 'Building the samples...' && echo -en 'travis_fold:start:script.4\\r' - make samples + - echo -en 'travis_fold:end:script.4\\r' + - echo 'Installing...' && echo -en 'travis_fold:start:script.5\\r' - sudo make install + - echo -en 'travis_fold:end:script.5\\r' + - echo 'Testing building with the installed version...' && echo -en 'travis_fold:start:script.6\\r' - make -C samples/minimal -f makefile.unx + - echo -en 'travis_fold:end:script.6\\r' From c86168132df78877f3e309631baaf3857f4310ef Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Dec 2015 15:09:57 +0100 Subject: [PATCH 2/5] Really check building using the installed version in Travis builds The command to do this at the end of the script didn't actually do anything because the minimal sample had been already built in tree before. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 271c74a676..c0f5ba5e8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,5 +49,5 @@ script: - sudo make install - echo -en 'travis_fold:end:script.5\\r' - echo 'Testing building with the installed version...' && echo -en 'travis_fold:start:script.6\\r' - - make -C samples/minimal -f makefile.unx + - make -C samples/minimal -f makefile.unx -B - echo -en 'travis_fold:end:script.6\\r' From 844a7e426aa8ef27544a19348b0df1d270d9461a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Dec 2015 18:03:53 +0100 Subject: [PATCH 3/5] Extract Travis before install script steps into a separate file This allows to do make these steps more complicated, e.g. avoid using apt-get under non-Linux (and even non-Debian/Ubuntu) platforms. Also install GTK+ development package explicitly, while it's already available on the older Travis Ubuntu 12.04 VMs, this is not the case for the newer 14.04 ones. --- .travis.yml | 4 +--- build/tools/before_install.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 build/tools/before_install.sh diff --git a/.travis.yml b/.travis.yml index c0f5ba5e8d..d82a6af109 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,9 +19,7 @@ notifications: on_success: change on_failure: change -before_install: - - sudo apt-get update - - sudo apt-get install -y libcppunit-dev +before_install: ./build/tools/before_install.sh env: - wxCONFIGURE_FLAGS= diff --git a/build/tools/before_install.sh b/build/tools/before_install.sh new file mode 100755 index 0000000000..1fd3fe1209 --- /dev/null +++ b/build/tools/before_install.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# This script is used by Travis CI to install the dependencies before building +# wxWidgets but can also be run by hand if necessary but currently it only +# works for Ubuntu 12.04 and 14.04 used by Travis. + +SUDO=sudo + +case $(uname -s) in + Linux) + if [ -f /etc/apt/sources.list ]; then + $SUDO apt-get update + $SUDO apt-get install -y libcppunit-dev libgtk2.0-dev libnotify-dev + fi + ;; +esac From 6a3b6600dd6d503c0480e9ec7b65b379d8590c13 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Dec 2015 15:56:44 +0100 Subject: [PATCH 4/5] Test builds with newer g++, clang and OS X on Travis CI Configure the build matrix to test building on more platforms and using clang as well and also test C++11 builds using both g++ and clang. --- .travis.yml | 23 ++++++++++++++++------- build/tools/before_install.sh | 7 ++++++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d82a6af109..9b4dccdafe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,22 @@ language: cpp sudo: required -compiler: gcc +matrix: + include: + - compiler: gcc + - compiler: gcc + env: wxCONFIGURE_FLAGS="--disable-precomp-headers --enable-monolithic" + - dist: trusty + compiler: gcc + - dist: trusty + compiler: gcc + env: wxCONFIGURE_FLAGS="--enable-cxx11 --enable-stl" + - dist: trusty + compiler: clang + env: wxCONFIGURE_FLAGS="--disable-shared" + - os: osx + compiler: clang + env: wxCONFIGURE_FLAGS="--enable-cxx11" branches: only: @@ -21,12 +36,6 @@ notifications: before_install: ./build/tools/before_install.sh -env: - - wxCONFIGURE_FLAGS= - - wxCONFIGURE_FLAGS="--disable-shared" - - wxCONFIGURE_FLAGS="--disable-precomp-headers --enable-monolithic" - - wxCONFIGURE_FLAGS="--enable-stl" CXXFLAGS=-std=c++0x - script: - echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r' - ./configure --disable-optimise $wxCONFIGURE_FLAGS diff --git a/build/tools/before_install.sh b/build/tools/before_install.sh index 1fd3fe1209..1adc73ed1b 100755 --- a/build/tools/before_install.sh +++ b/build/tools/before_install.sh @@ -2,7 +2,7 @@ # # This script is used by Travis CI to install the dependencies before building # wxWidgets but can also be run by hand if necessary but currently it only -# works for Ubuntu 12.04 and 14.04 used by Travis. +# works for Ubuntu 12.04 and 14.04 and OS X used by Travis builds. SUDO=sudo @@ -13,4 +13,9 @@ case $(uname -s) in $SUDO apt-get install -y libcppunit-dev libgtk2.0-dev libnotify-dev fi ;; + + Darwin) + brew update + brew install cppunit --universal + ;; esac From e6db20d908a952a657cbf79755b0a207b0c9c99b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 25 Jan 2016 01:26:33 +0100 Subject: [PATCH 5/5] Pass -std=c++11 when using Unix makefile on Travis explicitly wx-config doesn't include -std=c++11 in its output currently and it's not clear whether it should (consider c++11 vs gnu++11 or even vs c++14), so add this compiler option explicitly in C++11 Travis builds. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b4dccdafe..eff6913987 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,13 +14,13 @@ matrix: compiler: gcc - dist: trusty compiler: gcc - env: wxCONFIGURE_FLAGS="--enable-cxx11 --enable-stl" + env: wxCONFIGURE_FLAGS="--enable-cxx11 --enable-stl" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" - dist: trusty compiler: clang env: wxCONFIGURE_FLAGS="--disable-shared" - os: osx compiler: clang - env: wxCONFIGURE_FLAGS="--enable-cxx11" + env: wxCONFIGURE_FLAGS="--enable-cxx11" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" branches: only: @@ -56,5 +56,5 @@ script: - sudo make install - echo -en 'travis_fold:end:script.5\\r' - echo 'Testing building with the installed version...' && echo -en 'travis_fold:start:script.6\\r' - - make -C samples/minimal -f makefile.unx -B + - make -C samples/minimal -f makefile.unx -B $wxMAKEFILE_FLAGS - echo -en 'travis_fold:end:script.6\\r'