Add macOS support to travis

This commit is contained in:
Elichai Turkel 2020-05-02 22:06:04 +03:00
parent b6807d91d8
commit 0c5ff9066e
No known key found for this signature in database
GPG Key ID: 9383CDE9E8E66A7F
2 changed files with 27 additions and 11 deletions

View File

@ -1,5 +1,10 @@
language: c language: c
os: linux os:
- linux
- osx
# Valgrind currently supports upto macOS 10.13, the latest xcode of that version is 10.1
osx_image: xcode10.1
addons: addons:
apt: apt:
packages: packages:
@ -30,10 +35,13 @@ env:
- CFLAGS=-O0 CTIMETEST= - CFLAGS=-O0 CTIMETEST=
- ECMULTGENPRECISION=2 - ECMULTGENPRECISION=2
- ECMULTGENPRECISION=8 - ECMULTGENPRECISION=8
- VALGRIND=yes ENDOMORPHISM=yes BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
- VALGRIND=yes BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
matrix: matrix:
fast_finish: true fast_finish: true
include: include:
- compiler: clang - compiler: clang
os: linux
env: HOST=i686-linux-gnu ENDOMORPHISM=yes env: HOST=i686-linux-gnu ENDOMORPHISM=yes
addons: addons:
apt: apt:
@ -45,6 +53,7 @@ matrix:
- libc6-dbg:i386 - libc6-dbg:i386
- compiler: clang - compiler: clang
env: HOST=i686-linux-gnu env: HOST=i686-linux-gnu
os: linux
addons: addons:
apt: apt:
packages: packages:
@ -54,6 +63,7 @@ matrix:
- libc6-dbg:i386 - libc6-dbg:i386
- compiler: gcc - compiler: gcc
env: HOST=i686-linux-gnu ENDOMORPHISM=yes env: HOST=i686-linux-gnu ENDOMORPHISM=yes
os: linux
addons: addons:
apt: apt:
packages: packages:
@ -62,6 +72,7 @@ matrix:
- libtool-bin - libtool-bin
- libc6-dbg:i386 - libc6-dbg:i386
- compiler: gcc - compiler: gcc
os: linux
env: HOST=i686-linux-gnu env: HOST=i686-linux-gnu
addons: addons:
apt: apt:
@ -71,14 +82,12 @@ matrix:
- valgrind - valgrind
- libtool-bin - libtool-bin
- libc6-dbg:i386 - libc6-dbg:i386
- compiler: gcc
env: # We use this to install macOS dependencies instead of the built in `homebrew` plugin,
- BIGNUM=no ENDOMORPHISM=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes # because in xcode earlier than 11 they have a bug requiring updating the system which overall takes ~8 minutes.
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD= # https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296
- compiler: gcc before_install:
env: # The same as above but without endomorphism. - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install gmp valgrind gcc@9; fi
- BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
before_script: ./autogen.sh before_script: ./autogen.sh
@ -90,3 +99,5 @@ after_script:
- cat ./exhaustive_tests.log - cat ./exhaustive_tests.log
- cat ./valgrind_ctime_test.log - cat ./valgrind_ctime_test.log
- cat ./bench.log - cat ./bench.log
- $CC --version
- valgrind --version

View File

@ -11,6 +11,10 @@ if [ "$HOST" = "i686-linux-gnu" ]
then then
export CC="$CC -m32" export CC="$CC -m32"
fi fi
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TRAVIS_COMPILER" = "gcc" ]
then
export CC="gcc-9"
fi
./configure \ ./configure \
--enable-experimental="$EXPERIMENTAL" --enable-endomorphism="$ENDOMORPHISM" \ --enable-experimental="$EXPERIMENTAL" --enable-endomorphism="$ENDOMORPHISM" \
@ -33,7 +37,8 @@ if [ -n "$BENCH" ]
then then
if [ -n "$VALGRIND" ] if [ -n "$VALGRIND" ]
then then
EXEC='libtool --mode=execute valgrind --error-exitcode=42' # Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
EXEC='./libtool --mode=execute valgrind --error-exitcode=42'
else else
EXEC= EXEC=
fi fi
@ -54,5 +59,5 @@ then
fi fi
if [ -n "$CTIMETEST" ] if [ -n "$CTIMETEST" ]
then then
libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1 ./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
fi fi