blob: 1cc82562c18e137030d8196be5e0728c52d601f8 [file] [log] [blame]
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +01001#!/bin/sh
2
Simon Butcher3ea7f522016-03-07 23:22:10 +00003# all.sh
4#
5# Copyright (c) 2014-2016, ARM Limited, All Rights Reserved
6#
7# Purpose
8#
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +01009# Run all available tests (mostly).
10#
11# Warning: includes various build modes, so it will mess with the current
12# CMake configuration. After this script is run, the CMake cache is lost and
13# CMake is not initialised any more!
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +010014#
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +000015# Assumes gcc and clang (recent enough for using ASan with gcc and MemSan with
16# clang, or valgrind) are available, as well as cmake and a "good" find.
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010017
18# Abort on errors (and uninitiliased variables)
19set -eu
20
21if [ -d library -a -d include -a -d tests ]; then :; else
Manuel Pégourié-Gonnarde4f6edc2015-01-22 16:43:54 +000022 echo "Must be run from mbed TLS root" >&2
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010023 exit 1
24fi
25
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000026CONFIG_H='include/mbedtls/config.h'
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +020027CONFIG_BAK="$CONFIG_H.bak"
28
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010029MEMORY=0
Manuel Pégourié-Gonnard259b08a2016-01-08 16:27:41 +010030SHORT=0
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010031
32while [ $# -gt 0 ]; do
33 case "$1" in
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +010034 -m*)
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +000035 MEMORY=${1#-m}
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010036 ;;
Manuel Pégourié-Gonnard259b08a2016-01-08 16:27:41 +010037 -s)
38 SHORT=1
39 ;;
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010040 *)
41 echo "Unknown argument: '$1'" >&2
42 echo "Use the source, Luke!" >&2
43 exit 1
44 ;;
45 esac
46 shift
47done
48
49# remove built files as well as the cmake cache/config
50cleanup()
51{
52 make clean
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +020053
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +020054 find . -name yotta -prune -o -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} \+
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000055 rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile
Paul Bakkerfe0984d2014-06-13 00:13:45 +020056 git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile
57 git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +020058
59 if [ -f "$CONFIG_BAK" ]; then
60 mv "$CONFIG_BAK" "$CONFIG_H"
61 fi
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010062}
63
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +020064trap cleanup INT TERM HUP
65
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +010066msg()
67{
68 echo ""
69 echo "******************************************************************"
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +010070 echo "* $1 "
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +000071 printf "* "; date
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +010072 echo "******************************************************************"
73}
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010074
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +020075# The test ordering tries to optimize for the following criteria:
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +010076# 1. Catch possible problems early, by running first tests that run quickly
Manuel Pégourié-Gonnard61bc57a2014-08-14 11:29:06 +020077# and/or are more likely to fail than others (eg I use Clang most of the
78# time, so start with a GCC build).
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +020079# 2. Minimize total running time, by avoiding useless rebuilds
80#
81# Indicative running times are given for reference.
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010082
Manuel Pégourié-Gonnardea29d152014-11-20 17:32:33 +010083msg "test: recursion.pl" # < 1s
Manuel Pégourié-Gonnardd09a6b52015-04-09 17:19:23 +020084tests/scripts/recursion.pl library/*.c
Manuel Pégourié-Gonnardea29d152014-11-20 17:32:33 +010085
Manuel Pégourié-Gonnardb3b8e432015-02-13 14:52:19 +000086msg "test: freshness of generated source files" # < 1s
87tests/scripts/check-generated-files.sh
88
Manuel Pégourié-Gonnardd09a6b52015-04-09 17:19:23 +020089msg "test: doxygen markup outside doxygen blocks" # < 1s
90tests/scripts/check-doxy-blocks.pl
91
Manuel Pégourié-Gonnarda687baf2015-04-09 11:09:03 +020092msg "test/build: declared and exported names" # < 3s
93cleanup
94tests/scripts/check-names.sh
95
Manuel Pégourié-Gonnard1d552e72016-01-04 16:49:09 +010096if which doxygen >/dev/null; then
97 msg "test: doxygen warnings" # ~ 3s
98 cleanup
99 tests/scripts/doxygen.sh
100fi
101
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +0200102msg "build: create and build yotta module" # ~ 30s
103cleanup
104tests/scripts/yotta-build.sh
105
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100106msg "build: cmake, gcc, ASan" # ~ 1 min 50s
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100107cleanup
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100108CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100109make
110
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100111msg "test: main suites and selftest (ASan build)" # ~ 50s
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100112make test
113programs/test/selftest
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200114
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100115msg "test: ssl-opt.sh (ASan build)" # ~ 1 min
Manuel Pégourié-Gonnard3d404b42015-07-08 21:59:16 +0100116tests/ssl-opt.sh
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200117
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100118msg "test/build: ref-configs (ASan build)" # ~ 6 min 20s
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200119tests/scripts/test-ref-configs.pl
120
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100121# Most frequent issues are likely to be caught at this point
Manuel Pégourié-Gonnard259b08a2016-01-08 16:27:41 +0100122if [ $SHORT -eq 1 ]; then
123 msg "Done, cleaning up"
124 cleanup
125 exit 0
126fi
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200127
128msg "build: with ASan (rebuild after ref-configs)" # ~ 1 min
129make
130
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100131msg "test: compat.sh (ASan build)" # ~ 6 min
Manuel Pégourié-Gonnard3d404b42015-07-08 21:59:16 +0100132tests/compat.sh
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200133
Simon Butcher3ea7f522016-03-07 23:22:10 +0000134msg "build: Default + SSLv3 (ASan build)" # ~ 6 min
135cleanup
Simon Butcherf413b6f2016-03-14 22:32:42 +0000136cp "$CONFIG_H" "$CONFIG_BAK"
Simon Butcher3ea7f522016-03-07 23:22:10 +0000137scripts/config.pl set MBEDTLS_SSL_PROTO_SSL3
138CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
139make
140
141msg "test: SSLv3 - main suites and selftest (ASan build)" # ~ 50s
142make test
143programs/test/selftest
144
145msg "build: SSLv3 - compat.sh (ASan build)" # ~ 6 min
146tests/compat.sh -m 'ssl3 tls1 tls1_1 tls1_2 dtls1 dtls1_2'
147
148msg "build: SSLv3 - ssl-opt.sh (ASan build)" # ~ 6 min
149tests/ssl-opt.sh
150
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100151msg "build: cmake, full config, clang" # ~ 50s
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100152cleanup
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200153scripts/config.pl full
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200154scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100155CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check .
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100156make
157
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100158msg "test: main suites (full config)" # ~ 5s
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200159make test
160
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100161msg "test: ssl-opt.sh default (full config)" # ~ 1s
Manuel Pégourié-Gonnard3d404b42015-07-08 21:59:16 +0100162tests/ssl-opt.sh -f Default
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200163
Manuel Pégourié-Gonnardea0920f2015-03-24 09:50:15 +0100164msg "test: compat.sh RC4, DES & NULL (full config)" # ~ 2 min
Manuel Pégourié-Gonnard3d404b42015-07-08 21:59:16 +0100165tests/compat.sh -e '3DES\|DES-CBC3' -f 'NULL\|DES\|RC4\|ARCFOUR'
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200166
Manuel Pégourié-Gonnard503a5ef2015-10-23 09:04:45 +0200167msg "test/build: curves.pl (gcc)" # ~ 4 min
Manuel Pégourié-Gonnard246978d2014-11-20 13:29:53 +0100168cleanup
169cmake -D CMAKE_BUILD_TYPE:String=Debug .
170tests/scripts/curves.pl
171
Manuel Pégourié-Gonnard503a5ef2015-10-23 09:04:45 +0200172msg "test/build: key-exchanges (gcc)" # ~ 1 min
173cleanup
174cmake -D CMAKE_BUILD_TYPE:String=Check .
175tests/scripts/key-exchanges.pl
176
Manuel Pégourié-Gonnard61fe8b02015-03-13 14:33:16 +0000177msg "build: Unix make, -Os (gcc)" # ~ 30s
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100178cleanup
Manuel Pégourié-Gonnard61fe8b02015-03-13 14:33:16 +0000179CC=gcc CFLAGS='-Werror -Os' make
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100180
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200181# this is meant to cath missing #define mbedtls_printf etc
Manuel Pégourié-Gonnard981732b2015-02-17 15:46:45 +0000182# disable fsio to catch some more missing #include <stdio.h>
Manuel Pégourié-Gonnard757ca002015-03-23 15:24:07 +0100183msg "build: full config except platform/fsio, make, gcc" # ~ 30s
Manuel Pégourié-Gonnarda71780e2015-02-13 13:56:55 +0000184cleanup
185cp "$CONFIG_H" "$CONFIG_BAK"
186scripts/config.pl full
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200187scripts/config.pl unset MBEDTLS_PLATFORM_C
188scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY
Manuel Pégourié-Gonnard3d4755b2015-06-03 14:03:17 +0100189scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT
190scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT
191scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT
192scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200193scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C
194scripts/config.pl unset MBEDTLS_FS_IO
Manuel Pégourié-Gonnard61fe8b02015-03-13 14:33:16 +0000195CC=gcc CFLAGS='-Werror -O0' make
Manuel Pégourié-Gonnarda71780e2015-02-13 13:56:55 +0000196
Manuel Pégourié-Gonnarddccb80b2015-06-03 10:20:33 +0100197# catch compile bugs in _uninit functions
198msg "build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s
199cleanup
200cp "$CONFIG_H" "$CONFIG_BAK"
201scripts/config.pl full
Manuel Pégourié-Gonnard7ee5ddd2015-06-03 10:33:55 +0100202scripts/config.pl set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
Manuel Pégourié-Gonnarddccb80b2015-06-03 10:20:33 +0100203CC=gcc CFLAGS='-Werror -O0' make
204
Manuel Pégourié-Gonnard66b8e952015-05-20 11:13:56 +0200205msg "build: full config except ssl_srv.c, make, gcc" # ~ 30s
206cleanup
207cp "$CONFIG_H" "$CONFIG_BAK"
208scripts/config.pl full
209scripts/config.pl unset MBEDTLS_SSL_SRV_C
210CC=gcc CFLAGS='-Werror -O0' make
211
212msg "build: full config except ssl_cli.c, make, gcc" # ~ 30s
213cleanup
214cp "$CONFIG_H" "$CONFIG_BAK"
215scripts/config.pl full
216scripts/config.pl unset MBEDTLS_SSL_CLI_C
217CC=gcc CFLAGS='-Werror -O0' make
218
Manuel Pégourié-Gonnardf78e4de2015-05-29 10:52:14 +0200219msg "build: full config except net.c, make, gcc -std=c99 -pedantic" # ~ 30s
Manuel Pégourié-Gonnard009a2642015-05-29 10:31:13 +0200220cleanup
221cp "$CONFIG_H" "$CONFIG_BAK"
222scripts/config.pl full
Manuel Pégourié-Gonnardf78e4de2015-05-29 10:52:14 +0200223scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc.
224scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux
Manuel Pégourié-Gonnard71859362015-06-02 16:39:22 +0100225CC=gcc CFLAGS='-Werror -O0 -std=c99 -pedantic' make lib
Manuel Pégourié-Gonnard009a2642015-05-29 10:31:13 +0200226
Manuel Pégourié-Gonnard9b06abe2015-06-25 09:56:07 +0200227if uname -a | grep -F Linux >/dev/null; then
228msg "build/test: make shared" # ~ 40s
229cleanup
230make SHARED=1 all check
231fi
232
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000233if uname -a | grep -F x86_64 >/dev/null; then
234msg "build: i386, make, gcc" # ~ 30s
235cleanup
236CC=gcc CFLAGS='-Werror -m32' make
237fi # x86_64
238
239if which arm-none-eabi-gcc >/dev/null; then
240msg "build: arm-none-eabi-gcc, make" # ~ 10s
241cleanup
242cp "$CONFIG_H" "$CONFIG_BAK"
243scripts/config.pl full
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200244scripts/config.pl unset MBEDTLS_NET_C
245scripts/config.pl unset MBEDTLS_TIMING_C
246scripts/config.pl unset MBEDTLS_FS_IO
Simon Butcherbc6a4862016-03-07 17:35:59 +0000247scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000248# following things are not in the default config
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200249scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
250scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
251scripts/config.pl unset MBEDTLS_THREADING_C
252scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
253scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
Manuel Pégourié-Gonnarde058ea22015-06-25 09:04:13 +0200254CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS=-Werror make lib
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000255fi # arm-gcc
256
Manuel Pégourié-Gonnard6dc26512015-06-25 10:48:24 +0200257if which armcc >/dev/null && armcc --help >/dev/null 2>&1; then
Manuel Pégourié-Gonnardc5c59392015-02-10 17:38:54 +0100258msg "build: armcc, make"
259cleanup
260cp "$CONFIG_H" "$CONFIG_BAK"
261scripts/config.pl full
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200262scripts/config.pl unset MBEDTLS_NET_C
263scripts/config.pl unset MBEDTLS_TIMING_C
264scripts/config.pl unset MBEDTLS_FS_IO
265scripts/config.pl unset MBEDTLS_HAVE_TIME
Manuel Pégourié-Gonnardbbc60db2015-06-22 14:31:50 +0200266scripts/config.pl unset MBEDTLS_HAVE_TIME_DATE
Simon Butcherbc6a4862016-03-07 17:35:59 +0000267scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
Manuel Pégourié-Gonnardc5c59392015-02-10 17:38:54 +0100268# following things are not in the default config
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200269scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING
270scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
271scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
272scripts/config.pl unset MBEDTLS_THREADING_C
273scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
274scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
Manuel Pégourié-Gonnard35519012016-01-07 13:06:51 +0100275CC=armcc AR=armar WARNING_CFLAGS= make lib 2> armcc.stderr
Manuel Pégourié-Gonnard129e4132015-03-13 17:29:18 +0100276if [ -s armcc.stderr ]; then
277 cat armcc.stderr
278 exit 1;
279fi
Manuel Pégourié-Gonnardc5c59392015-02-10 17:38:54 +0100280rm armcc.stderr
281fi # armcc
282
Manuel Pégourié-Gonnard6448bce2015-02-16 17:18:36 +0100283if which i686-w64-mingw32-gcc >/dev/null; then
284msg "build: cross-mingw64, make" # ~ 30s
285cleanup
Manuel Pégourié-Gonnarde058ea22015-06-25 09:04:13 +0200286CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS=-Werror WINDOWS_BUILD=1 make
Manuel Pégourié-Gonnard52fa38a2015-06-23 14:29:58 +0200287WINDOWS_BUILD=1 make clean
Manuel Pégourié-Gonnarde33316c2015-08-07 13:17:23 +0200288CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS=-Werror WINDOWS_BUILD=1 SHARED=1 make
289WINDOWS_BUILD=1 make clean
Manuel Pégourié-Gonnard6448bce2015-02-16 17:18:36 +0100290fi
291
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000292# MemSan currently only available on Linux 64 bits
293if uname -a | grep 'Linux.*x86_64' >/dev/null; then
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000294
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100295msg "build: MSan (clang)" # ~ 1 min 20s
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100296cleanup
297cp "$CONFIG_H" "$CONFIG_BAK"
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200298scripts/config.pl unset MBEDTLS_AESNI_C # memsan doesn't grok asm
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100299CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan .
300make
Manuel Pégourié-Gonnard4a9dc2a2014-05-09 13:46:59 +0200301
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100302msg "test: main suites (MSan)" # ~ 10s
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100303make test
304
305msg "test: ssl-opt.sh (MSan)" # ~ 1 min
Manuel Pégourié-Gonnard3d404b42015-07-08 21:59:16 +0100306tests/ssl-opt.sh
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100307
308# Optional part(s)
309
310if [ "$MEMORY" -gt 0 ]; then
311 msg "test: compat.sh (MSan)" # ~ 6 min 20s
Manuel Pégourié-Gonnard3d404b42015-07-08 21:59:16 +0100312 tests/compat.sh
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200313fi
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100314
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000315else # no MemSan
316
317msg "build: Release (clang)"
318cleanup
319CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release .
320make
321
322msg "test: main suites valgrind (Release)"
Manuel Pégourié-Gonnard9afdc832015-08-04 17:15:13 +0200323make memcheck
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000324
325# Optional part(s)
326# Currently broken, programs don't seem to receive signals
327# under valgrind on OS X
328
329if [ "$MEMORY" -gt 0 ]; then
330 msg "test: ssl-opt.sh --memcheck (Release)"
Manuel Pégourié-Gonnard3d404b42015-07-08 21:59:16 +0100331 tests/ssl-opt.sh --memcheck
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000332fi
333
334if [ "$MEMORY" -gt 1 ]; then
335 msg "test: compat.sh --memcheck (Release)"
Manuel Pégourié-Gonnard3d404b42015-07-08 21:59:16 +0100336 tests/compat.sh --memcheck
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000337fi
338
339fi # MemSan
340
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100341msg "Done, cleaning up"
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100342cleanup
343