Add libevent testing to Travis

This commit is contained in:
Jeffrey Walton 2020-03-17 06:46:18 -04:00
parent e4268663e6
commit dafe849c5b
No known key found for this signature in database
GPG key ID: B36AB348921B1838
4 changed files with 80 additions and 28 deletions

View file

@ -10,6 +10,11 @@ addons:
- libevent-dev - libevent-dev
- libexpat-dev - libexpat-dev
- clang - clang
homebrew:
packages:
- openssl
- libevent
update: true
jobs: jobs:
include: include:
@ -17,68 +22,109 @@ jobs:
name: GCC on Linux, Amd64 name: GCC on Linux, Amd64
compiler: gcc compiler: gcc
arch: amd64 arch: amd64
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: Clang on Linux, Amd64 name: Clang on Linux, Amd64
compiler: clang compiler: clang
arch: amd64 arch: amd64
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: osx - os: osx
name: Clang on OS X, Amd64 name: Clang on OS X, Amd64
compiler: clang compiler: clang
arch: amd64 arch: amd64
env:
- CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/"
- os: linux
name: Libevent, GCC on Linux, Amd64
compiler: gcc
arch: amd64
env:
- TEST_LIBEVENT=yes
- CONFIG_OPTS="--with-libevent"
- os: linux
name: Libevent, Clang on Linux, Amd64
compiler: clang
arch: amd64
- TEST_LIBEVENT=yes
- CONFIG_OPTS="--with-libevent"
- os: osx
name: Libevent, Clang on OS X, Amd64
compiler: clang
arch: amd64
- TEST_LIBEVENT=yes
- CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl/ --with-libevent=/usr/local/opt/libevent/"
- os: linux - os: linux
name: UBsan, GCC on Linux, Amd64 name: UBsan, GCC on Linux, Amd64
compiler: gcc compiler: gcc
arch: amd64 arch: amd64
dist: bionic dist: bionic
env: TEST_UBSAN=yes env:
- TEST_UBSAN=yes
- os: linux - os: linux
name: UBsan, Clang on Linux, Amd64 name: UBsan, Clang on Linux, Amd64
compiler: clang compiler: clang
arch: amd64 arch: amd64
dist: bionic dist: bionic
env: TEST_UBSAN=yes env:
- TEST_UBSAN=yes
- os: linux - os: linux
name: Asan, GCC on Linux, Amd64 name: Asan, GCC on Linux, Amd64
compiler: gcc compiler: gcc
arch: amd64 arch: amd64
dist: bionic dist: bionic
env: TEST_ASAN=yes env:
- TEST_ASAN=yes
- os: linux - os: linux
name: Asan, Clang on Linux, Amd64 name: Asan, Clang on Linux, Amd64
compiler: clang compiler: clang
arch: amd64 arch: amd64
dist: bionic dist: bionic
env: TEST_ASAN=yes env:
- TEST_ASAN=yes
- os: linux - os: linux
name: GCC on Linux, Aarch64 name: GCC on Linux, Aarch64
compiler: gcc compiler: gcc
arch: arm64 arch: arm64
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: Clang on Linux, Aarch64 name: Clang on Linux, Aarch64
compiler: clang compiler: clang
arch: arm64 arch: arm64
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: GCC on Linux, PowerPC64 name: GCC on Linux, PowerPC64
compiler: gcc compiler: gcc
arch: ppc64le arch: ppc64le
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: Clang on Linux, PowerPC64 name: Clang on Linux, PowerPC64
compiler: clang compiler: clang
arch: ppc64le arch: ppc64le
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: GCC on Linux, s390x name: GCC on Linux, s390x
compiler: gcc compiler: gcc
arch: s390x arch: s390x
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: Clang on Linux, s390x name: Clang on Linux, s390x
compiler: clang compiler: clang
arch: s390x arch: s390x
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: osx - os: osx
osx_image: xcode10 osx_image: xcode10
name: Apple iPhone, OS X, Amd64 name: Apple iPhone, OS X, Amd64
@ -196,6 +242,14 @@ jobs:
arch: amd64 arch: amd64
name: Android x86_64, Linux, Amd64 name: Android x86_64, Linux, Amd64
before_script:
- |
if [ "$TEST_ANDROID" = "yes" ]; then
./contrib/android/install_tools.sh
elif [ "$TEST_IOS" = "yes" ]; then
./contrib/ios/install_tools.sh
fi
# The Travis docs say to avoid calling exit in the script. It leads to # The Travis docs say to avoid calling exit in the script. It leads to
# some code duplication to avoid failures in cross-compiles. Also see # some code duplication to avoid failures in cross-compiles. Also see
# https://docs.travis-ci.com/user/job-lifecycle/ in the Travis docs. # https://docs.travis-ci.com/user/job-lifecycle/ in the Travis docs.
@ -215,7 +269,6 @@ script:
export AUTOTOOLS_BUILD="$(./config.guess)" export AUTOTOOLS_BUILD="$(./config.guess)"
export PKG_CONFIG_PATH="$IOS_PREFIX/lib/pkgconfig" export PKG_CONFIG_PATH="$IOS_PREFIX/lib/pkgconfig"
source ./contrib/ios/setenv_ios.sh source ./contrib/ios/setenv_ios.sh
./contrib/ios/install_tools.sh
./contrib/ios/install_openssl.sh ./contrib/ios/install_openssl.sh
./contrib/ios/install_expat.sh ./contrib/ios/install_expat.sh
./configure \ ./configure \
@ -230,7 +283,6 @@ script:
export PKG_CONFIG_PATH="$ANDROID_PREFIX/lib/pkgconfig" export PKG_CONFIG_PATH="$ANDROID_PREFIX/lib/pkgconfig"
./contrib/android/install_ndk.sh ./contrib/android/install_ndk.sh
source ./contrib/android/setenv_android.sh source ./contrib/android/setenv_android.sh
./contrib/android/install_tools.sh
./contrib/android/install_openssl.sh ./contrib/android/install_openssl.sh
./contrib/android/install_expat.sh ./contrib/android/install_expat.sh
./configure \ ./configure \
@ -240,13 +292,8 @@ script:
--with-libexpat="$ANDROID_PREFIX"; --with-libexpat="$ANDROID_PREFIX";
make -j 2 make -j 2
make install make install
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/
make -j 2
make test
(cd testdata/clang-analysis.tdir; bash clang-analysis.test)
else else
./configure --enable-debug --disable-flto ./configure ${CONFIG_OPTS}
make -j 2 make -j 2
make test make test
(cd testdata/clang-analysis.tdir; bash clang-analysis.test) (cd testdata/clang-analysis.tdir; bash clang-analysis.test)

View file

@ -1218,28 +1218,29 @@ esac
# check for libevent # check for libevent
AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname], AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname],
[use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr or you can specify an explicit path). Slower, but allows use of large outgoing port ranges.]), [use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr or you can specify an explicit path). Slower, but allows use of large outgoing port ranges.]),
[ ],[ withval="no" ]) [ ],[ with_libevent="no" ])
if test x_$withval = x_yes -o x_$withval != x_no; then if test "x_$with_libevent" != x_no; then
AC_DEFINE([USE_LIBEVENT], [1], [Define if you enable libevent])
AC_MSG_CHECKING(for libevent) AC_MSG_CHECKING(for libevent)
if test x_$withval = x_ -o x_$withval = x_yes; then if test "x_$with_libevent" = x_ -o "x_$with_libevent" = x_yes; then
withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" with_libevent="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr"
fi fi
for dir in $withval; do for dir in $with_libevent; do
thedir="$dir" thedir="$dir"
if test -f "$dir/include/event.h" -o -f "$dir/include/event2/event.h"; then if test -f "$dir/include/event.h" -o -f "$dir/include/event2/event.h"; then
found_libevent="yes" found_libevent="yes"
dnl assume /usr is in default path. dnl assume /usr is in default path.
if test "$thedir" != "/usr"; then if test "$thedir" != "/usr"; then
CPPFLAGS="$CPPFLAGS -I$thedir/include" CPPFLAGS="$CPPFLAGS -I$thedir/include"
fi fi
break; break;
fi fi
done done
if test x_$found_libevent != x_yes; then if test x_$found_libevent != x_yes; then
if test -f "$dir/event.h" -a \( -f "$dir/libevent.la" -o -f "$dir/libev.la" \) ; then if test -f "$dir/event.h" -a \( -f "$dir/libevent.la" -o -f "$dir/libev.la" \) ; then
# libevent source directory # libevent source directory
AC_MSG_RESULT(found in $thedir) AC_MSG_RESULT(found in $thedir)
CPPFLAGS="$CPPFLAGS -I$thedir -I$thedir/include" CPPFLAGS="$CPPFLAGS -I$thedir -I$thedir/include"
BAK_LDFLAGS_SET="1" BAK_LDFLAGS_SET="1"
BAK_LDFLAGS="$LDFLAGS" BAK_LDFLAGS="$LDFLAGS"
# remove evdns from linking # remove evdns from linking
@ -1252,10 +1253,10 @@ if test x_$withval = x_yes -o x_$withval != x_no; then
cp $ev_files_o build/libevent cp $ev_files_o build/libevent
cp $ev_files_lo build/libevent cp $ev_files_lo build/libevent
cp $ev_files_libso build/libevent/.libs cp $ev_files_libso build/libevent/.libs
LATE_LDFLAGS="build/libevent/*.lo -lm" LATE_LDFLAGS="build/libevent/*.lo -lm"
LDFLAGS="build/libevent/*.o $LDFLAGS -lm" LDFLAGS="build/libevent/*.o $LDFLAGS -lm"
else else
AC_MSG_ERROR([Cannot find the libevent library in $withval AC_MSG_ERROR([Cannot find the libevent library in $with_libevent
You can restart ./configure --with-libevent=no to use a builtin alternative. You can restart ./configure --with-libevent=no to use a builtin alternative.
Please note that this alternative is not as capable as libevent when using Please note that this alternative is not as capable as libevent when using
large outgoing port ranges. ]) large outgoing port ranges. ])

View file

@ -3,4 +3,4 @@
# This step should install tools needed for all packages - OpenSSL, Expat and Unbound # This step should install tools needed for all packages - OpenSSL, Expat and Unbound
echo "Updating tools" echo "Updating tools"
sudo apt-get -qq update sudo apt-get -qq update
sudo apt-get -qq install --no-install-recommends curl tar zip unzip perl openjdk-8-jdk autoconf automake libtool pkgconfig sudo apt-get -qq install --no-install-recommends curl tar zip unzip perl openjdk-8-jdk autoconf automake libtool pkg-config

View file

@ -867,7 +867,11 @@ main(int argc, char* argv[])
printf("\tperforms unit tests.\n"); printf("\tperforms unit tests.\n");
return 1; return 1;
} }
#ifdef USE_LIBEVENT
printf("Start of %s+libevent unit test.\n", PACKAGE_STRING);
#else
printf("Start of %s unit test.\n", PACKAGE_STRING); printf("Start of %s unit test.\n", PACKAGE_STRING);
#endif
#ifdef HAVE_SSL #ifdef HAVE_SSL
# ifdef HAVE_ERR_LOAD_CRYPTO_STRINGS # ifdef HAVE_ERR_LOAD_CRYPTO_STRINGS
ERR_load_crypto_strings(); ERR_load_crypto_strings();