Introduce Travis CI tests

In order to libbpf to be used in systemd some testing is required, see related
discussions in https://github.com/systemd/systemd/pull/12151 and
https://github.com/libbpf/libbpf/pull/29
The tests introduced here mirrors the tests of systemd:
For Debian: build with gcc, gcc + asan, clang, clang + asan
Debian tests use `docker` virtualization
Fror Ubuntu Xenial: build with gcc

The differences:
Install only libelf and it's dependencies.
Instead of Meson build system `make` is used, so `make` remains the preferred
method of building and `meson.build` doesn't get rooted in `libbpf`.

`travis_wait.bash` is kept as a workaround for
https://github.com/travis-ci/travis-ci/issues/9979

An example of testing UI: https://travis-ci.org/wat-ze-hex/libbpf
This commit is contained in:
hex
2019-04-17 11:02:45 -07:00
committed by yonghong-song
parent 65b4e9359a
commit 2d1959ff60
4 changed files with 227 additions and 0 deletions

15
travis-ci/managers/xenial.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -e
set -x
apt-get update
apt-get -y build-dep libelf-dev
apt-get install -y libelf-dev
source "$(dirname $0)/travis_wait.bash"
cd $REPO_ROOT
mkdir build
make CFLAGS='-Werror -Db_sanitize=address,undefined' -C ./src -B OBJDIR=../build
rm -rf build