Skip to content

Commit 6a091c3

Browse files
committed
Add macOS support to travis
1 parent fdbbadd commit 6a091c3

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

.travis.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
language: c
2-
os: linux
2+
os:
3+
- linux
4+
- osx
5+
cache:
6+
directories:
7+
- $HOME/Library/Caches/Homebrew
8+
- /usr/local/Homebrew
9+
before_cache:
10+
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
11+
12+
# Valgrind currently supports upto macOS 10.13, the latest xcode of that version is 10.1
13+
osx_image: xcode10.1
314
addons:
415
apt:
516
packages:
617
- libgmp-dev
718
- valgrind
819
- libtool-bin
20+
homebrew:
21+
update: true
22+
packages:
23+
- gmp
24+
- valgrind
25+
- gcc@9
926
compiler:
1027
- clang
1128
- gcc
@@ -30,10 +47,13 @@ env:
3047
- CFLAGS=-O0 CTIMETEST=
3148
- ECMULTGENPRECISION=2
3249
- ECMULTGENPRECISION=8
50+
- VALGRIND=yes ENDOMORPHISM=yes BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
51+
- VALGRIND=yes BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
3352
matrix:
3453
fast_finish: true
3554
include:
3655
- compiler: clang
56+
os: linux
3757
env: HOST=i686-linux-gnu ENDOMORPHISM=yes
3858
addons:
3959
apt:
@@ -45,6 +65,7 @@ matrix:
4565
- libc6-dbg:i386
4666
- compiler: clang
4767
env: HOST=i686-linux-gnu
68+
os: linux
4869
addons:
4970
apt:
5071
packages:
@@ -54,6 +75,7 @@ matrix:
5475
- libc6-dbg:i386
5576
- compiler: gcc
5677
env: HOST=i686-linux-gnu ENDOMORPHISM=yes
78+
os: linux
5779
addons:
5880
apt:
5981
packages:
@@ -62,6 +84,7 @@ matrix:
6284
- libtool-bin
6385
- libc6-dbg:i386
6486
- compiler: gcc
87+
os: linux
6588
env: HOST=i686-linux-gnu
6689
addons:
6790
apt:
@@ -71,14 +94,6 @@ matrix:
7194
- valgrind
7295
- libtool-bin
7396
- libc6-dbg:i386
74-
- compiler: gcc
75-
env:
76-
- BIGNUM=no ENDOMORPHISM=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes
77-
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
78-
- compiler: gcc
79-
env: # The same as above but without endomorphism.
80-
- BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes
81-
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
8297

8398
before_script: ./autogen.sh
8499

@@ -90,3 +105,5 @@ after_script:
90105
- cat ./exhaustive_tests.log
91106
- cat ./valgrind_ctime_test.log
92107
- cat ./bench.log
108+
- $CC --version
109+
- valgrind --version

contrib/travis.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ if [ "$HOST" = "i686-linux-gnu" ]
1111
then
1212
export CC="$CC -m32"
1313
fi
14+
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TRAVIS_COMPILER" = "gcc" ]
15+
then
16+
export CC="gcc-9"
17+
fi
1418

1519
./configure \
1620
--enable-experimental="$EXPERIMENTAL" --enable-endomorphism="$ENDOMORPHISM" \
@@ -33,7 +37,8 @@ if [ -n "$BENCH" ]
3337
then
3438
if [ -n "$VALGRIND" ]
3539
then
36-
EXEC='libtool --mode=execute valgrind --error-exitcode=42'
40+
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
41+
EXEC='./libtool --mode=execute valgrind --error-exitcode=42'
3742
else
3843
EXEC=
3944
fi
@@ -52,5 +57,5 @@ then
5257
fi
5358
if [ -n "$CTIMETEST" ]
5459
then
55-
libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
60+
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
5661
fi

0 commit comments

Comments
 (0)