Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test using clang, gcc-4.8 i386 #60

Merged
merged 12 commits into from
Jun 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env bash

set -exE

export CC="$MYCC"
export PREFIX="$HOME/build"
export PATH="$PREFIX/bin:$PATH"
export CFLAGS="-g -O3 -L$PREFIX/lib $CFLAGS"
export CPPFLAGS="-I$PREFIX/include"
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:/usr/lib/$ARCH-linux-gnu/pkgconfig"

if [ "$COVERAGE" = "true" ]; then
export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
export LDFLAGS="$LDFLAGS --coverage"
fi

case $1 in
before_install)
apt-add-repository -y ppa:ubuntu-toolchain-r/test
apt-add-repository -y ppa:jbboehr/build-deps
apt-add-repository -y ppa:jbboehr/handlebars
apt-get update -y
apt-get install $MYCC
apt-get install -y automake bison flex gperf pkg-config re2c gcc-multilib
# install arch-specific packages
apt-get install -y check:$ARCH libjson-c-dev:$ARCH liblmdb-dev:$ARCH libpcre3-dev:$ARCH libtalloc-dev:$ARCH libyaml-dev:$ARCH libsubunit-dev:$ARCH
if [ "$COVERAGE" = "true" ]; then
apt-get install -y lcov
gem install coveralls-lcov
fi
;;

install)
trap "cat config.log" ERR
./bootstrap
./configure --build="$ARCH" --prefix="$PREFIX" --enable-handlebars-memory
make clean all
;;

before_script)
if [ "$COVERAGE" = "true" ]; then
lcov --directory . --zerocounters
lcov --directory . --capture --compat-libtool --initial --output-file coverage.info
fi
;;

script)
make check install
;;

after_success)
if [ "$COVERAGE" = "true" ]; then
lcov --no-checksum --directory . --capture --compat-libtool --output-file coverage.info
lcov --remove coverage.info "/usr*" --remove coverage.info "*/tests/*" --remove coverage.info "handlebars.tab.c" --remove coverage.info "handlebars.lex.c" --remove coverage.info "handlebars_scanners.c" --compat-libtool --output-file coverage.info
coveralls-lcov coverage.info
fi
;;

after_failure)
if [ "$COVERAGE" = "true" ]; then
for i in `find tests -name "*.log" 2>/dev/null`; do
echo "-- START ${i}";
cat $i;
echo "-- END";
done
fi
;;
esac

exit 0

49 changes: 14 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ dist: trusty

env:
global:
- PREFIX="$HOME/build"
- PATH="$PREFIX/bin:$PATH"
- CFLAGS="-L$PREFIX/lib"
- CPPFLAGS="-I$PREFIX/include"
- PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
- ARCH="amd64"
- COVERAGE="true"
matrix:
- MYCC="gcc-4.9"
- MYCC="gcc-5"
- MYCC="gcc-6"
- MYCC="gcc-7"
- MYCC="gcc-4.8"
ARCH="i386"
CFLAGS="-m32"
COVERAGE="false"
- MYCC="clang-3.8"
COVERAGE="false"

cache: false

Expand All @@ -24,33 +27,9 @@ branches:
- master
- travis

before_install:
- "CC=$MYCC"
- travis_retry sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
- travis_retry sudo apt-add-repository -y ppa:jbboehr/build-deps
- travis_retry sudo apt-add-repository -y ppa:jbboehr/handlebars
- travis_retry sudo apt-get update -y
- travis_retry sudo apt-get install -y $CC
- travis_retry sudo apt-get install -y automake bison check flex gperf lcov libjson-c-dev liblmdb-dev libpcre3-dev libtalloc-dev libyaml-dev pkg-config re2c
- travis_retry gem install coveralls-lcov

install:
- ./bootstrap
- ./configure --prefix="$PREFIX" --enable-handlebars-memory CFLAGS="-g -O3 --coverage -fprofile-arcs -ftest-coverage $CFLAGS" LDFLAGS="--coverage"
- make clean all

before_script:
- lcov --directory . --zerocounters
- lcov --directory . --capture --compat-libtool --initial --output-file coverage.info

script:
- make check install

after_success:
- lcov --no-checksum --directory . --capture --compat-libtool --output-file coverage.info
- lcov --remove coverage.info "/usr*" --remove coverage.info "*/tests/*" --remove coverage.info "handlebars.tab.c" --remove coverage.info "handlebars.lex.c" --remove coverage.info "handlebars_scanners.c" --compat-libtool --output-file coverage.info
- coveralls-lcov coverage.info

after_failure:
- for i in `find tests -name "*.log" 2>/dev/null`; do echo "-- START ${i}"; cat $i; echo "-- END"; done

before_install: travis_retry sudo ./.travis.sh before_install
install: travis_retry sudo ./.travis.sh install
before_script: sudo ./.travis.sh before_script
script: sudo ./.travis.sh script
after_success: travis_retry sudo ./.travis.sh after_success
after_failure: travis_retry sudo ./.travis.sh after_failure