Skip to content

Commit

Permalink
Moved Coverity integration back to Travis, while tests run in the con…
Browse files Browse the repository at this point in the history
…tainer
  • Loading branch information
dimkr committed Dec 23, 2017
1 parent fb1fa15 commit 21fbae7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ 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-

script:
- ci_env=`bash <(curl -s https://codecov.io/env)`
- docker build -t b6b -f Dockerfile .
- docker run $ci_env -w /root b6b ./ci_build.sh
- mkdir builds
- docker run -v $PWD/builds:/builds -w /root b6b ./ci_build.sh

after_success:
- cd builds/coverage; bash <(curl -s https://codecov.io/bash)

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 curl
RUN apt-get -y --no-install-recommends install gcc clang ninja-build locales python3-pip python3-setuptools python3-wheel libffi-dev valgrind
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,31 +16,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.

rm -rf build build-clang build-no-threads build-small build-coverage

export CFLAGS=-g
meson -Dwith_valgrind=true build
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
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

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

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

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

for i in build build-clang
# run all tests
for i in /builds/gcc /builds/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 @@ -49,13 +48,12 @@ done
# this is required to work around missing suppressions in glibc's symbol lookup
export LD_BIND_NOW=1

for i in build build-clang
# run all tests, with Valgrind
for i in /builds/gcc /builds/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

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

0 comments on commit 21fbae7

Please sign in to comment.