Skip to content

Commit

Permalink
Moved coverage reporting to the container, again
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Dec 24, 2017
1 parent c9a4693 commit b3c52db
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
11 changes: 2 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,11 @@ services:
- docker

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y curl
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt

script:
- docker build -t b6b -f Dockerfile .
- mkdir builds
- docker run -v $PWD/builds:/builds -w /root b6b ./ci_build.sh

after_success:
- ln -s $PWD /tmp/b6b
- cd builds/coverage; bash <(curl -s https://codecov.io/bash)
- docker run `curl -s https://codecov.io/env | bash` -w /root b6b ./ci_build.sh

addons:
coverity_scan:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ENV LANG en_US.UTF-8

RUN sed -i s/^deb.*multiverse.*/\#\&/g /etc/apt/sources.list
RUN apt-get -qq update
RUN apt-get -y --no-install-recommends install gcc clang ninja-build locales python3-pip python3-setuptools python3-wheel libffi-dev valgrind
RUN apt-get -y --no-install-recommends install gcc clang ninja-build locales python3-pip python3-setuptools python3-wheel libffi-dev valgrind curl
RUN locale-gen --lang en_US.UTF-8
RUN pip3 install meson

Expand Down
32 changes: 15 additions & 17 deletions ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# we want coverage data to point to source files at identical paths, inside and outside of the container
ln -s `pwd` /tmp/b6b
cd /tmp/b6b

export CFLAGS=-g
meson -Dwith_valgrind=true /builds/gcc
CC=clang meson -Dwith_valgrind=true /builds/clang
meson -Dwith_threads=false -Dwith_valgrind=true /builds/no-threads
meson -Dwith_threads=false -Dwith_miniz=false -Dwith_linenoise=false /builds/small
meson -Db_coverage=true -Doptimistic_alloc=false /builds/coverage
meson -Dwith_valgrind=true build-gcc
CC=clang meson -Dwith_valgrind=true build-clang
meson -Dwith_threads=false -Dwith_valgrind=true build-no-threads
meson -Dwith_threads=false -Dwith_miniz=false -Dwith_linenoise=false build-small
meson -Db_coverage=true -Doptimistic_alloc=false build-coverage

# build with GCC, clang, with GCC while thread support is disabled and a small build with all optional features off
for i in /builds/gcc /builds/clang /builds/no-threads
for i in build-gcc build-clang build-no-threads
do
ninja -C $i
meson configure -Dbuildtype=release $i
DESTDIR=dest ninja -C $i install
done

DESTDIR=dest ninja -C /builds/small install
meson test -C /builds/small --no-rebuild --print-errorlogs
DESTDIR=dest ninja -C build-small install
meson test -C build-small --no-rebuild --print-errorlogs

# rebuild the small build with a static library
meson configure -Ddefault_library=static /builds/small
DESTDIR=dest-static ninja -C /builds/small install
meson configure -Ddefault_library=static build-small
DESTDIR=dest-static ninja -C build-small install

# run all tests
for i in /builds/gcc /builds/clang
for i in build-gcc build-clang
do
meson test -C $i --no-rebuild --print-errorlogs --repeat 5
meson test -C $i --no-rebuild --print-errorlogs --wrapper "taskset -c 0"
Expand All @@ -53,11 +49,13 @@ done
export LD_BIND_NOW=1

# run all tests, with Valgrind
for i in /builds/gcc /builds/clang
for i in build-gcc build-clang
do
meson test -C $i --no-rebuild --print-errorlogs --no-suite=b6b:slow --num-processes 1 -t 2 --wrapper "valgrind --leak-check=full --error-exitcode=1 --malloc-fill=1 --free-fill=1 --track-fds=yes"
meson test -C $i --no-rebuild --print-errorlogs --no-suite=b6b:slow --num-processes 1 -t 2 --wrapper "valgrind --tool=helgrind --error-exitcode=1"
meson test -C $i --no-rebuild --print-errorlogs --no-suite=b6b:slow --num-processes 1 -t 2 --wrapper "valgrind --tool=helgrind --error-exitcode=1 --fair-sched=yes"
done

meson test -C /builds/coverage
meson test -C build-coverage
cd build-coverage
curl -s https://codecov.io/bash | bash

0 comments on commit b3c52db

Please sign in to comment.