Andres AG | 31f9b5b | 2016-10-04 17:14:38 +0100 | [diff] [blame] | 1 | #! /usr/bin/env sh |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 2 | |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 3 | # all.sh |
| 4 | # |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) |
| 6 | # |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 7 | # Copyright (c) 2014-2016, ARM Limited, All Rights Reserved |
| 8 | # |
| 9 | # Purpose |
| 10 | # |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 11 | # To run all tests possible or available on the platform. |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 12 | # |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 13 | # Warning: the test is destructive. It includes various build modes and |
| 14 | # configurations, and can and will arbitrarily change the current CMake |
| 15 | # configuration. After this script has been run, the CMake cache will be lost |
| 16 | # and CMake will no longer be initialised. |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 17 | # |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 18 | # The script assumes the presence of gcc and clang (recent enough for using |
| 19 | # ASan with gcc and MemSan with clang, or valgrind) are available, as well as |
| 20 | # cmake and a "good" find. |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 21 | |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 22 | # Abort on errors (and uninitialised variables) |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 23 | set -eu |
| 24 | |
Andres AG | 38495a3 | 2016-07-12 16:54:33 +0100 | [diff] [blame] | 25 | if [ "$( uname )" != "Linux" ]; then |
| 26 | echo "This script only works in Linux" >&2 |
| 27 | exit 1 |
| 28 | elif [ -d library -a -d include -a -d tests ]; then :; else |
| 29 | echo "Must be run from mbed TLS root" >&2 |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 30 | exit 1 |
| 31 | fi |
| 32 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 33 | CONFIG_H='include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 34 | CONFIG_BAK="$CONFIG_H.bak" |
| 35 | |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 36 | MEMORY=0 |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 37 | FORCE=0 |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 38 | KEEP_GOING=0 |
Andres AG | 7770ea8 | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 39 | RELEASE=0 |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 40 | RUN_ARMCC=1 |
Gilles Peskine | da51925 | 2017-11-30 13:22:04 +0100 | [diff] [blame] | 41 | YOTTA=1 |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 42 | |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 43 | # Default commands, can be overriden by the environment |
| 44 | : ${OPENSSL:="openssl"} |
| 45 | : ${OPENSSL_LEGACY:="$OPENSSL"} |
| 46 | : ${GNUTLS_CLI:="gnutls-cli"} |
| 47 | : ${GNUTLS_SERV:="gnutls-serv"} |
| 48 | : ${GNUTLS_LEGACY_CLI:="$GNUTLS_CLI"} |
| 49 | : ${GNUTLS_LEGACY_SERV:="$GNUTLS_SERV"} |
Andres AG | dc19221 | 2016-08-31 17:33:13 +0100 | [diff] [blame] | 50 | : ${OUT_OF_SOURCE_DIR:=./mbedtls_out_of_source_build} |
Andres AG | 87bb577 | 2016-09-27 15:05:15 +0100 | [diff] [blame] | 51 | : ${ARMC5_BIN_DIR:=/usr/bin} |
| 52 | : ${ARMC6_BIN_DIR:=/usr/bin} |
Andres AG | dc19221 | 2016-08-31 17:33:13 +0100 | [diff] [blame] | 53 | |
Andres AG | 38495a3 | 2016-07-12 16:54:33 +0100 | [diff] [blame] | 54 | # if MAKEFLAGS is not set add the -j option to speed up invocations of make |
| 55 | if [ -n "${MAKEFLAGS+set}" ]; then |
| 56 | export MAKEFLAGS="-j" |
| 57 | fi |
| 58 | |
Simon Butcher | 41eeccf | 2016-09-07 00:07:09 +0100 | [diff] [blame] | 59 | usage() |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 60 | { |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 61 | cat <<EOF |
| 62 | Usage: $0 [OPTION]... |
| 63 | -h|--help Print this help. |
| 64 | |
| 65 | General options: |
| 66 | -f|--force Force the tests to overwrite any modified files. |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 67 | -k|--keep-going Run all tests and report errors at the end. |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 68 | -m|--memory Additional optional memory tests. |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 69 | --armcc Run ARM Compiler builds (on by default). |
| 70 | --no-armcc Skip ARM Compiler builds. |
Gilles Peskine | 2a22a80 | 2017-12-21 15:19:00 +0100 | [diff] [blame] | 71 | --no-yotta Skip yotta module build. |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 72 | --out-of-source-dir=<path> Directory used for CMake out-of-source build tests. |
| 73 | -r|--release-test Run this script in release mode. This fixes the seed value to 1. |
| 74 | -s|--seed Integer seed value to use for this test run. |
Gilles Peskine | 2a22a80 | 2017-12-21 15:19:00 +0100 | [diff] [blame] | 75 | --yotta Build yotta module (on by default). |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 76 | |
| 77 | Tool path options: |
| 78 | --armc5-bin-dir=<ARMC5_bin_dir_path> ARM Compiler 5 bin directory. |
| 79 | --armc6-bin-dir=<ARMC6_bin_dir_path> ARM Compiler 6 bin directory. |
| 80 | --gnutls-cli=<GnuTLS_cli_path> GnuTLS client executable to use for most tests. |
| 81 | --gnutls-serv=<GnuTLS_serv_path> GnuTLS server executable to use for most tests. |
| 82 | --gnutls-legacy-cli=<GnuTLS_cli_path> GnuTLS client executable to use for legacy tests. |
| 83 | --gnutls-legacy-serv=<GnuTLS_serv_path> GnuTLS server executable to use for legacy tests. |
| 84 | --openssl=<OpenSSL_path> OpenSSL executable to use for most tests. |
| 85 | --openssl-legacy=<OpenSSL_path> OpenSSL executable to use for legacy tests e.g. SSLv3. |
| 86 | EOF |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 87 | } |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 88 | |
| 89 | # remove built files as well as the cmake cache/config |
| 90 | cleanup() |
| 91 | { |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 92 | command make clean |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 93 | |
Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 94 | find . -name yotta -prune -o -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} \+ |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 95 | rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile |
Paul Bakker | fe0984d | 2014-06-13 00:13:45 +0200 | [diff] [blame] | 96 | git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile |
| 97 | git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 98 | |
| 99 | if [ -f "$CONFIG_BAK" ]; then |
| 100 | mv "$CONFIG_BAK" "$CONFIG_H" |
| 101 | fi |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 102 | } |
| 103 | |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 104 | # Executed on exit. May be redefined depending on command line options. |
| 105 | final_report () { |
| 106 | : |
| 107 | } |
| 108 | |
| 109 | fatal_signal () { |
| 110 | cleanup |
| 111 | final_report $1 |
| 112 | trap - $1 |
| 113 | kill -$1 $$ |
| 114 | } |
| 115 | |
| 116 | trap 'fatal_signal HUP' HUP |
| 117 | trap 'fatal_signal INT' INT |
| 118 | trap 'fatal_signal TERM' TERM |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 119 | |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 120 | msg() |
| 121 | { |
| 122 | echo "" |
| 123 | echo "******************************************************************" |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 124 | echo "* $1 " |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 125 | printf "* "; date |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 126 | echo "******************************************************************" |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 127 | current_section=$1 |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 128 | } |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 129 | |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 130 | if [ $RUN_ARMCC -ne 0 ]; then |
| 131 | armc6_build_test() |
| 132 | { |
| 133 | FLAGS="$1" |
Andres AG | a5cd973 | 2016-10-17 15:23:10 +0100 | [diff] [blame] | 134 | |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 135 | msg "build: ARM Compiler 6 ($FLAGS), make" |
| 136 | ARM_TOOL_VARIANT="ult" CC="$ARMC6_CC" AR="$ARMC6_AR" CFLAGS="$FLAGS" \ |
| 137 | WARNING_CFLAGS='-xc -std=c99' make lib |
| 138 | make clean |
| 139 | } |
| 140 | fi |
Andres AG | a5cd973 | 2016-10-17 15:23:10 +0100 | [diff] [blame] | 141 | |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 142 | err_msg() |
| 143 | { |
| 144 | echo "$1" >&2 |
| 145 | } |
| 146 | |
| 147 | check_tools() |
| 148 | { |
| 149 | for TOOL in "$@"; do |
| 150 | if ! `hash "$TOOL" >/dev/null 2>&1`; then |
| 151 | err_msg "$TOOL not found!" |
| 152 | exit 1 |
| 153 | fi |
| 154 | done |
| 155 | } |
| 156 | |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 157 | while [ $# -gt 0 ]; do |
| 158 | case "$1" in |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 159 | --armcc) |
| 160 | RUN_ARMCC=1 |
| 161 | ;; |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 162 | --armc5-bin-dir) |
| 163 | shift |
| 164 | ARMC5_BIN_DIR="$1" |
| 165 | ;; |
| 166 | --armc6-bin-dir) |
| 167 | shift |
| 168 | ARMC6_BIN_DIR="$1" |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 169 | ;; |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 170 | --force|-f) |
| 171 | FORCE=1 |
| 172 | ;; |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 173 | --gnutls-cli) |
| 174 | shift |
| 175 | GNUTLS_CLI="$1" |
| 176 | ;; |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 177 | --gnutls-legacy-cli) |
| 178 | shift |
| 179 | GNUTLS_LEGACY_CLI="$1" |
| 180 | ;; |
| 181 | --gnutls-legacy-serv) |
| 182 | shift |
| 183 | GNUTLS_LEGACY_SERV="$1" |
| 184 | ;; |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 185 | --gnutls-serv) |
Andres AG | 87bb577 | 2016-09-27 15:05:15 +0100 | [diff] [blame] | 186 | shift |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 187 | GNUTLS_SERV="$1" |
Andres AG | 87bb577 | 2016-09-27 15:05:15 +0100 | [diff] [blame] | 188 | ;; |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 189 | --help|-h) |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 190 | usage |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 191 | exit |
| 192 | ;; |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 193 | --keep-going|-k) |
| 194 | KEEP_GOING=1 |
| 195 | ;; |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 196 | --memory|-m) |
| 197 | MEMORY=1 |
| 198 | ;; |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 199 | --no-armcc) |
| 200 | RUN_ARMCC=0 |
| 201 | ;; |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 202 | --no-yotta) |
| 203 | YOTTA=0 |
| 204 | ;; |
| 205 | --openssl) |
| 206 | shift |
| 207 | OPENSSL="$1" |
| 208 | ;; |
| 209 | --openssl-legacy) |
| 210 | shift |
| 211 | OPENSSL_LEGACY="$1" |
| 212 | ;; |
| 213 | --out-of-source-dir) |
| 214 | shift |
| 215 | OUT_OF_SOURCE_DIR="$1" |
| 216 | ;; |
| 217 | --release-test|-r) |
| 218 | RELEASE=1 |
| 219 | ;; |
| 220 | --seed|-s) |
| 221 | shift |
| 222 | SEED="$1" |
| 223 | ;; |
Gilles Peskine | 2a22a80 | 2017-12-21 15:19:00 +0100 | [diff] [blame] | 224 | --yotta) |
| 225 | YOTTA=1 |
| 226 | ;; |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 227 | *) |
| 228 | echo >&2 "Unknown option: $1" |
| 229 | echo >&2 "Run $0 --help for usage." |
| 230 | exit 120 |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 231 | ;; |
| 232 | esac |
| 233 | shift |
| 234 | done |
| 235 | |
| 236 | if [ $FORCE -eq 1 ]; then |
Gilles Peskine | da51925 | 2017-11-30 13:22:04 +0100 | [diff] [blame] | 237 | if [ $YOTTA -eq 1 ]; then |
| 238 | rm -rf yotta/module "$OUT_OF_SOURCE_DIR" |
| 239 | fi |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 240 | git checkout-index -f -q $CONFIG_H |
| 241 | cleanup |
| 242 | else |
| 243 | |
Gilles Peskine | 2a22a80 | 2017-12-21 15:19:00 +0100 | [diff] [blame] | 244 | if [ $YOTTA -ne 0 ] && [ -d yotta/module ]; then |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 245 | err_msg "Warning - there is an existing yotta module in the directory 'yotta/module'" |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 246 | echo "You can either delete your work and retry, or force the test to overwrite the" |
| 247 | echo "test by rerunning the script as: $0 --force" |
| 248 | exit 1 |
| 249 | fi |
| 250 | |
Andres AG | dc19221 | 2016-08-31 17:33:13 +0100 | [diff] [blame] | 251 | if [ -d "$OUT_OF_SOURCE_DIR" ]; then |
| 252 | echo "Warning - there is an existing directory at '$OUT_OF_SOURCE_DIR'" >&2 |
| 253 | echo "You can either delete this directory manually, or force the test by rerunning" |
| 254 | echo "the script as: $0 --force --out-of-source-dir $OUT_OF_SOURCE_DIR" |
| 255 | exit 1 |
| 256 | fi |
| 257 | |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 258 | if ! git diff-files --quiet include/mbedtls/config.h; then |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 259 | err_msg "Warning - the configuration file 'include/mbedtls/config.h' has been edited. " |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 260 | echo "You can either delete or preserve your work, or force the test by rerunning the" |
| 261 | echo "script as: $0 --force" |
| 262 | exit 1 |
| 263 | fi |
| 264 | fi |
| 265 | |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 266 | build_status=0 |
| 267 | if [ $KEEP_GOING -eq 1 ]; then |
| 268 | failure_summary= |
| 269 | failure_count=0 |
| 270 | start_red= |
| 271 | end_color= |
| 272 | if [ -t 1 ]; then |
| 273 | case "$TERM" in |
| 274 | *color*|cygwin|linux|rxvt*|screen|[Eex]term*) |
| 275 | start_red=$(printf '\033[31m') |
| 276 | end_color=$(printf '\033[0m') |
| 277 | ;; |
| 278 | esac |
| 279 | fi |
| 280 | record_status () { |
| 281 | if "$@"; then |
| 282 | last_status=0 |
| 283 | else |
| 284 | last_status=$? |
| 285 | text="$current_section: $* -> $last_status" |
| 286 | failure_summary="$failure_summary |
| 287 | $text" |
| 288 | failure_count=$((failure_count + 1)) |
| 289 | echo "${start_red}^^^^$text^^^^${end_color}" |
| 290 | fi |
| 291 | } |
| 292 | make () { |
| 293 | case "$*" in |
| 294 | *test|*check) |
| 295 | if [ $build_status -eq 0 ]; then |
| 296 | record_status command make "$@" |
| 297 | else |
| 298 | echo "(skipped because the build failed)" |
| 299 | fi |
| 300 | ;; |
| 301 | *) |
| 302 | record_status command make "$@" |
| 303 | build_status=$last_status |
| 304 | ;; |
| 305 | esac |
| 306 | } |
| 307 | final_report () { |
| 308 | if [ $failure_count -gt 0 ]; then |
| 309 | echo |
| 310 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
| 311 | echo "${start_red}FAILED: $failure_count${end_color}$failure_summary" |
| 312 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
| 313 | elif [ -z "${1-}" ]; then |
| 314 | echo "SUCCESS :)" |
| 315 | fi |
| 316 | if [ -n "${1-}" ]; then |
| 317 | echo "Killed by SIG$1." |
| 318 | fi |
| 319 | } |
| 320 | else |
| 321 | record_status () { |
| 322 | "$@" |
| 323 | } |
| 324 | fi |
| 325 | if_build_succeeded () { |
| 326 | if [ $build_status -eq 0 ]; then |
| 327 | record_status "$@" |
| 328 | fi |
| 329 | } |
| 330 | |
Andres AG | 7770ea8 | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 331 | if [ $RELEASE -eq 1 ]; then |
| 332 | # Fix the seed value to 1 to ensure that the tests are deterministic. |
| 333 | SEED=1 |
| 334 | fi |
| 335 | |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 336 | msg "info: $0 configuration" |
| 337 | echo "MEMORY: $MEMORY" |
| 338 | echo "FORCE: $FORCE" |
Andres AG | 7770ea8 | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 339 | echo "SEED: ${SEED-"UNSET"}" |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 340 | echo "OPENSSL: $OPENSSL" |
| 341 | echo "OPENSSL_LEGACY: $OPENSSL_LEGACY" |
| 342 | echo "GNUTLS_CLI: $GNUTLS_CLI" |
| 343 | echo "GNUTLS_SERV: $GNUTLS_SERV" |
| 344 | echo "GNUTLS_LEGACY_CLI: $GNUTLS_LEGACY_CLI" |
| 345 | echo "GNUTLS_LEGACY_SERV: $GNUTLS_LEGACY_SERV" |
Andres AG | 87bb577 | 2016-09-27 15:05:15 +0100 | [diff] [blame] | 346 | echo "ARMC5_BIN_DIR: $ARMC5_BIN_DIR" |
| 347 | echo "ARMC6_BIN_DIR: $ARMC6_BIN_DIR" |
| 348 | |
| 349 | ARMC5_CC="$ARMC5_BIN_DIR/armcc" |
| 350 | ARMC5_AR="$ARMC5_BIN_DIR/armar" |
| 351 | ARMC6_CC="$ARMC6_BIN_DIR/armclang" |
| 352 | ARMC6_AR="$ARMC6_BIN_DIR/armar" |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 353 | |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 354 | # To avoid setting OpenSSL and GnuTLS for each call to compat.sh and ssl-opt.sh |
| 355 | # we just export the variables they require |
| 356 | export OPENSSL_CMD="$OPENSSL" |
| 357 | export GNUTLS_CLI="$GNUTLS_CLI" |
| 358 | export GNUTLS_SERV="$GNUTLS_SERV" |
| 359 | |
Andres AG | 7770ea8 | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 360 | # Avoid passing --seed flag in every call to ssl-opt.sh |
| 361 | [ ! -z ${SEED+set} ] && export SEED |
| 362 | |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 363 | # Make sure the tools we need are available. |
| 364 | check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$GNUTLS_CLI" "$GNUTLS_SERV" \ |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 365 | "$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV" "doxygen" "dot" \ |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 366 | "arm-none-eabi-gcc" "i686-w64-mingw32-gcc" |
| 367 | if [ $RUN_ARMCC -ne 0 ]; then |
| 368 | check_tools "$ARMC5_CC" "$ARMC5_AR" "$ARMC6_CC" "$ARMC6_AR" |
| 369 | fi |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 370 | |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 371 | # |
| 372 | # Test Suites to be executed |
| 373 | # |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 374 | # The test ordering tries to optimize for the following criteria: |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 375 | # 1. Catch possible problems early, by running first tests that run quickly |
Manuel Pégourié-Gonnard | 61bc57a | 2014-08-14 11:29:06 +0200 | [diff] [blame] | 376 | # and/or are more likely to fail than others (eg I use Clang most of the |
| 377 | # time, so start with a GCC build). |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 378 | # 2. Minimize total running time, by avoiding useless rebuilds |
| 379 | # |
| 380 | # Indicative running times are given for reference. |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 381 | |
Janos Follath | b72c678 | 2016-07-19 14:54:17 +0100 | [diff] [blame] | 382 | msg "info: output_env.sh" |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 383 | OPENSSL="$OPENSSL" OPENSSL_LEGACY="$OPENSSL_LEGACY" GNUTLS_CLI="$GNUTLS_CLI" \ |
| 384 | GNUTLS_SERV="$GNUTLS_SERV" GNUTLS_LEGACY_CLI="$GNUTLS_LEGACY_CLI" \ |
Andres AG | 87bb577 | 2016-09-27 15:05:15 +0100 | [diff] [blame] | 385 | GNUTLS_LEGACY_SERV="$GNUTLS_LEGACY_SERV" ARMC5_CC="$ARMC5_CC" \ |
| 386 | ARMC6_CC="$ARMC6_CC" scripts/output_env.sh |
Janos Follath | b72c678 | 2016-07-19 14:54:17 +0100 | [diff] [blame] | 387 | |
Manuel Pégourié-Gonnard | ea29d15 | 2014-11-20 17:32:33 +0100 | [diff] [blame] | 388 | msg "test: recursion.pl" # < 1s |
Manuel Pégourié-Gonnard | d09a6b5 | 2015-04-09 17:19:23 +0200 | [diff] [blame] | 389 | tests/scripts/recursion.pl library/*.c |
Manuel Pégourié-Gonnard | ea29d15 | 2014-11-20 17:32:33 +0100 | [diff] [blame] | 390 | |
Manuel Pégourié-Gonnard | b3b8e43 | 2015-02-13 14:52:19 +0000 | [diff] [blame] | 391 | msg "test: freshness of generated source files" # < 1s |
| 392 | tests/scripts/check-generated-files.sh |
| 393 | |
Manuel Pégourié-Gonnard | d09a6b5 | 2015-04-09 17:19:23 +0200 | [diff] [blame] | 394 | msg "test: doxygen markup outside doxygen blocks" # < 1s |
| 395 | tests/scripts/check-doxy-blocks.pl |
| 396 | |
Manuel Pégourié-Gonnard | a687baf | 2015-04-09 11:09:03 +0200 | [diff] [blame] | 397 | msg "test/build: declared and exported names" # < 3s |
| 398 | cleanup |
| 399 | tests/scripts/check-names.sh |
| 400 | |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 401 | msg "test: doxygen warnings" # ~ 3s |
| 402 | cleanup |
| 403 | tests/scripts/doxygen.sh |
Manuel Pégourié-Gonnard | 1d552e7 | 2016-01-04 16:49:09 +0100 | [diff] [blame] | 404 | |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 405 | if [ $RUN_ARMCC -ne 0 ] && [ $YOTTA -ne 0 ]; then |
| 406 | # Note - use of yotta is deprecated, and yotta also requires armcc to be on the |
| 407 | # path, and uses whatever version of armcc it finds there. |
Gilles Peskine | da51925 | 2017-11-30 13:22:04 +0100 | [diff] [blame] | 408 | msg "build: create and build yotta module" # ~ 30s |
| 409 | cleanup |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 410 | record_status tests/scripts/yotta-build.sh |
Gilles Peskine | da51925 | 2017-11-30 13:22:04 +0100 | [diff] [blame] | 411 | fi |
Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 412 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 413 | msg "build: cmake, gcc, ASan" # ~ 1 min 50s |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 414 | cleanup |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 415 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 416 | make |
| 417 | |
Simon Butcher | 8e3afc7 | 2016-09-15 17:13:08 +0100 | [diff] [blame] | 418 | msg "test: main suites (inc. selftests) (ASan build)" # ~ 50s |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 419 | make test |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 420 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 421 | msg "test: ssl-opt.sh (ASan build)" # ~ 1 min |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 422 | if_build_succeeded tests/ssl-opt.sh |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 423 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 424 | msg "test/build: ref-configs (ASan build)" # ~ 6 min 20s |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 425 | if_build_succeeded tests/scripts/test-ref-configs.pl |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 426 | |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 427 | msg "build: with ASan (rebuild after ref-configs)" # ~ 1 min |
| 428 | make |
| 429 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 430 | msg "test: compat.sh (ASan build)" # ~ 6 min |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 431 | if_build_succeeded tests/compat.sh |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 432 | |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 433 | msg "build: Default + SSLv3 (ASan build)" # ~ 6 min |
| 434 | cleanup |
Simon Butcher | f413b6f | 2016-03-14 22:32:42 +0000 | [diff] [blame] | 435 | cp "$CONFIG_H" "$CONFIG_BAK" |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 436 | scripts/config.pl set MBEDTLS_SSL_PROTO_SSL3 |
| 437 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 438 | make |
| 439 | |
Simon Butcher | 8e3afc7 | 2016-09-15 17:13:08 +0100 | [diff] [blame] | 440 | msg "test: SSLv3 - main suites (inc. selftests) (ASan build)" # ~ 50s |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 441 | make test |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 442 | |
| 443 | msg "build: SSLv3 - compat.sh (ASan build)" # ~ 6 min |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 444 | if_build_succeeded tests/compat.sh -m 'tls1 tls1_1 tls1_2 dtls1 dtls1_2' |
| 445 | if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" tests/compat.sh -m 'ssl3' |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 446 | |
| 447 | msg "build: SSLv3 - ssl-opt.sh (ASan build)" # ~ 6 min |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 448 | if_build_succeeded tests/ssl-opt.sh |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 449 | |
Hanno Becker | 134c2ab | 2017-10-12 15:29:50 +0100 | [diff] [blame] | 450 | msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min |
| 451 | cleanup |
| 452 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 453 | scripts/config.pl unset MBEDTLS_SSL_RENEGOTIATION |
| 454 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 455 | make |
| 456 | |
| 457 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 458 | make test |
| 459 | |
| 460 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - ssl-opt.sh (ASan build)" # ~ 6 min |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 461 | if_build_succeeded tests/ssl-opt.sh |
Hanno Becker | 134c2ab | 2017-10-12 15:29:50 +0100 | [diff] [blame] | 462 | |
Simon Butcher | f95c176 | 2016-11-10 17:25:58 +0000 | [diff] [blame] | 463 | msg "build: cmake, full config, clang, C99" # ~ 50s |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 464 | cleanup |
Janos Follath | 35d48cb | 2016-04-22 14:45:00 +0100 | [diff] [blame] | 465 | cp "$CONFIG_H" "$CONFIG_BAK" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 466 | scripts/config.pl full |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 467 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests |
Simon Butcher | f95c176 | 2016-11-10 17:25:58 +0000 | [diff] [blame] | 468 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check -D ENABLE_TESTING=On . |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 469 | make CFLAGS='-Werror -Wall -Wextra -std=c99 -pedantic' |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 470 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 471 | msg "test: main suites (full config)" # ~ 5s |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 472 | make CFLAGS='-Werror -Wall -Wextra' test |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 473 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 474 | msg "test: ssl-opt.sh default (full config)" # ~ 1s |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 475 | if_build_succeeded tests/ssl-opt.sh -f Default |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 476 | |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 477 | msg "test: compat.sh RC4, DES & NULL (full config)" # ~ 2 min |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 478 | if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" GNUTLS_CLI="$GNUTLS_LEGACY_CLI" GNUTLS_SERV="$GNUTLS_LEGACY_SERV" tests/compat.sh -e '3DES\|DES-CBC3' -f 'NULL\|DES\|RC4\|ARCFOUR' |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 479 | |
Manuel Pégourié-Gonnard | 503a5ef | 2015-10-23 09:04:45 +0200 | [diff] [blame] | 480 | msg "test/build: curves.pl (gcc)" # ~ 4 min |
Manuel Pégourié-Gonnard | 246978d | 2014-11-20 13:29:53 +0100 | [diff] [blame] | 481 | cleanup |
| 482 | cmake -D CMAKE_BUILD_TYPE:String=Debug . |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 483 | if_build_succeeded tests/scripts/curves.pl |
Manuel Pégourié-Gonnard | 246978d | 2014-11-20 13:29:53 +0100 | [diff] [blame] | 484 | |
Manuel Pégourié-Gonnard | 503a5ef | 2015-10-23 09:04:45 +0200 | [diff] [blame] | 485 | msg "test/build: key-exchanges (gcc)" # ~ 1 min |
| 486 | cleanup |
| 487 | cmake -D CMAKE_BUILD_TYPE:String=Check . |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 488 | if_build_succeeded tests/scripts/key-exchanges.pl |
Manuel Pégourié-Gonnard | 503a5ef | 2015-10-23 09:04:45 +0200 | [diff] [blame] | 489 | |
Manuel Pégourié-Gonnard | 61fe8b0 | 2015-03-13 14:33:16 +0000 | [diff] [blame] | 490 | msg "build: Unix make, -Os (gcc)" # ~ 30s |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 491 | cleanup |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 492 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -Os' |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 493 | |
Simon Butcher | f95c176 | 2016-11-10 17:25:58 +0000 | [diff] [blame] | 494 | # Full configuration build, without platform support, file IO and net sockets. |
| 495 | # This should catch missing mbedtls_printf definitions, and by disabling file |
| 496 | # IO, it should catch missing '#include <stdio.h>' |
| 497 | msg "build: full config except platform/fsio/net, make, gcc, C99" # ~ 30s |
Manuel Pégourié-Gonnard | a71780e | 2015-02-13 13:56:55 +0000 | [diff] [blame] | 498 | cleanup |
| 499 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 500 | scripts/config.pl full |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 501 | scripts/config.pl unset MBEDTLS_PLATFORM_C |
Simon Butcher | f95c176 | 2016-11-10 17:25:58 +0000 | [diff] [blame] | 502 | scripts/config.pl unset MBEDTLS_NET_C |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 503 | scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY |
Manuel Pégourié-Gonnard | 3d4755b | 2015-06-03 14:03:17 +0100 | [diff] [blame] | 504 | scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT |
| 505 | scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT |
| 506 | scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT |
Simon Butcher | b928343 | 2016-07-13 11:02:41 +0100 | [diff] [blame] | 507 | scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT |
Manuel Pégourié-Gonnard | 3d4755b | 2015-06-03 14:03:17 +0100 | [diff] [blame] | 508 | scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT |
Simon Butcher | 284b4c9 | 2016-06-26 13:10:00 +0100 | [diff] [blame] | 509 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 510 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 511 | scripts/config.pl unset MBEDTLS_FS_IO |
Simon Butcher | cb58700 | 2017-01-06 16:14:44 +0000 | [diff] [blame] | 512 | # Note, _DEFAULT_SOURCE needs to be defined for platforms using glibc version >2.19, |
| 513 | # to re-enable platform integration features otherwise disabled in C99 builds |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 514 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -std=c99 -pedantic -O0 -D_DEFAULT_SOURCE' lib programs |
| 515 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' test |
Manuel Pégourié-Gonnard | a71780e | 2015-02-13 13:56:55 +0000 | [diff] [blame] | 516 | |
Manuel Pégourié-Gonnard | dccb80b | 2015-06-03 10:20:33 +0100 | [diff] [blame] | 517 | # catch compile bugs in _uninit functions |
| 518 | msg "build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s |
| 519 | cleanup |
| 520 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 521 | scripts/config.pl full |
Manuel Pégourié-Gonnard | 7ee5ddd | 2015-06-03 10:33:55 +0100 | [diff] [blame] | 522 | scripts/config.pl set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS |
Simon Butcher | eebf1b9 | 2016-06-27 01:42:39 +0100 | [diff] [blame] | 523 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 524 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' |
Manuel Pégourié-Gonnard | dccb80b | 2015-06-03 10:20:33 +0100 | [diff] [blame] | 525 | |
Manuel Pégourié-Gonnard | 66b8e95 | 2015-05-20 11:13:56 +0200 | [diff] [blame] | 526 | msg "build: full config except ssl_srv.c, make, gcc" # ~ 30s |
| 527 | cleanup |
| 528 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 529 | scripts/config.pl full |
| 530 | scripts/config.pl unset MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 531 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' |
Manuel Pégourié-Gonnard | 66b8e95 | 2015-05-20 11:13:56 +0200 | [diff] [blame] | 532 | |
| 533 | msg "build: full config except ssl_cli.c, make, gcc" # ~ 30s |
| 534 | cleanup |
| 535 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 536 | scripts/config.pl full |
| 537 | scripts/config.pl unset MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 538 | make CC=gcc CFLAGS='-Werror -Wall -Werror -O0' |
Manuel Pégourié-Gonnard | 66b8e95 | 2015-05-20 11:13:56 +0200 | [diff] [blame] | 539 | |
Simon Butcher | f95c176 | 2016-11-10 17:25:58 +0000 | [diff] [blame] | 540 | # Note, C99 compliance can also be tested with the sockets support disabled, |
| 541 | # as that requires a POSIX platform (which isn't the same as C99). |
Andres AG | 788aa4a | 2016-09-14 14:32:09 +0100 | [diff] [blame] | 542 | msg "build: full config except net_sockets.c, make, gcc -std=c99 -pedantic" # ~ 30s |
Manuel Pégourié-Gonnard | 009a264 | 2015-05-29 10:31:13 +0200 | [diff] [blame] | 543 | cleanup |
| 544 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 545 | scripts/config.pl full |
Manuel Pégourié-Gonnard | f78e4de | 2015-05-29 10:52:14 +0200 | [diff] [blame] | 546 | scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc. |
| 547 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 548 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0 -std=c99 -pedantic' lib |
Manuel Pégourié-Gonnard | 009a264 | 2015-05-29 10:31:13 +0200 | [diff] [blame] | 549 | |
Hanno Becker | 5175ac6 | 2017-09-18 15:36:25 +0100 | [diff] [blame] | 550 | msg "build: default config except MFL extension (ASan build)" # ~ 30s |
| 551 | cleanup |
| 552 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 553 | scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 554 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 555 | make |
| 556 | |
| 557 | msg "test: ssl-opt.sh, MFL-related tests" |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 558 | if_build_succeeded tests/ssl-opt.sh -f "Max fragment length" |
Hanno Becker | 5175ac6 | 2017-09-18 15:36:25 +0100 | [diff] [blame] | 559 | |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 560 | msg "build: default config with MBEDTLS_TEST_NULL_ENTROPY (ASan build)" |
Janos Follath | 06c5400 | 2016-06-09 13:57:40 +0100 | [diff] [blame] | 561 | cleanup |
| 562 | cp "$CONFIG_H" "$CONFIG_BAK" |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 563 | scripts/config.pl set MBEDTLS_TEST_NULL_ENTROPY |
Janos Follath | 06c5400 | 2016-06-09 13:57:40 +0100 | [diff] [blame] | 564 | scripts/config.pl set MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES |
| 565 | scripts/config.pl set MBEDTLS_ENTROPY_C |
| 566 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
| 567 | scripts/config.pl unset MBEDTLS_ENTROPY_HARDWARE_ALT |
| 568 | scripts/config.pl unset MBEDTLS_HAVEGE_C |
Simon Butcher | eebf1b9 | 2016-06-27 01:42:39 +0100 | [diff] [blame] | 569 | CC=gcc cmake -D UNSAFE_BUILD=ON -D CMAKE_C_FLAGS:String="-fsanitize=address -fno-common -O3" . |
Janos Follath | 06c5400 | 2016-06-09 13:57:40 +0100 | [diff] [blame] | 570 | make |
| 571 | |
Simon Butcher | 8e3afc7 | 2016-09-15 17:13:08 +0100 | [diff] [blame] | 572 | msg "test: MBEDTLS_TEST_NULL_ENTROPY - main suites (inc. selftests) (ASan build)" |
Janos Follath | 06c5400 | 2016-06-09 13:57:40 +0100 | [diff] [blame] | 573 | make test |
Janos Follath | 06c5400 | 2016-06-09 13:57:40 +0100 | [diff] [blame] | 574 | |
Manuel Pégourié-Gonnard | 9b06abe | 2015-06-25 09:56:07 +0200 | [diff] [blame] | 575 | if uname -a | grep -F Linux >/dev/null; then |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 576 | msg "build/test: make shared" # ~ 40s |
| 577 | cleanup |
| 578 | make SHARED=1 all check |
Manuel Pégourié-Gonnard | 9b06abe | 2015-06-25 09:56:07 +0200 | [diff] [blame] | 579 | fi |
| 580 | |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 581 | if uname -a | grep -F x86_64 >/dev/null; then |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 582 | msg "build: i386, make, gcc" # ~ 30s |
| 583 | cleanup |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 584 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -m32' |
Andres Amaya Garcia | 5e873fb | 2017-05-04 11:35:51 +0100 | [diff] [blame] | 585 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 586 | msg "build: gcc, force 32-bit compilation" |
| 587 | cleanup |
| 588 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 589 | scripts/config.pl unset MBEDTLS_HAVE_ASM |
| 590 | scripts/config.pl unset MBEDTLS_AESNI_C |
| 591 | scripts/config.pl unset MBEDTLS_PADLOCK_C |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 592 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT32' |
Andres Amaya Garcia | 5e873fb | 2017-05-04 11:35:51 +0100 | [diff] [blame] | 593 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 594 | msg "build: gcc, force 64-bit compilation" |
| 595 | cleanup |
| 596 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 597 | scripts/config.pl unset MBEDTLS_HAVE_ASM |
| 598 | scripts/config.pl unset MBEDTLS_AESNI_C |
| 599 | scripts/config.pl unset MBEDTLS_PADLOCK_C |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 600 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT64' |
Andres Amaya Garcia | 9946783 | 2017-07-20 13:21:34 +0100 | [diff] [blame] | 601 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 602 | msg "test: gcc, force 64-bit compilation" |
| 603 | make test |
Andres Amaya Garcia | 9946783 | 2017-07-20 13:21:34 +0100 | [diff] [blame] | 604 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 605 | msg "build: gcc, force 64-bit compilation" |
| 606 | cleanup |
| 607 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 608 | scripts/config.pl unset MBEDTLS_HAVE_ASM |
| 609 | scripts/config.pl unset MBEDTLS_AESNI_C |
| 610 | scripts/config.pl unset MBEDTLS_PADLOCK_C |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 611 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT64' |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 612 | fi # x86_64 |
| 613 | |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 614 | msg "build: arm-none-eabi-gcc, make" # ~ 10s |
| 615 | cleanup |
| 616 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 617 | scripts/config.pl full |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 618 | scripts/config.pl unset MBEDTLS_NET_C |
| 619 | scripts/config.pl unset MBEDTLS_TIMING_C |
| 620 | scripts/config.pl unset MBEDTLS_FS_IO |
Simon Butcher | eebf1b9 | 2016-06-27 01:42:39 +0100 | [diff] [blame] | 621 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
Simon Butcher | bc6a486 | 2016-03-07 17:35:59 +0000 | [diff] [blame] | 622 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 623 | # following things are not in the default config |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 624 | scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c |
| 625 | scripts/config.pl unset MBEDTLS_THREADING_PTHREAD |
| 626 | scripts/config.pl unset MBEDTLS_THREADING_C |
| 627 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h |
| 628 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 629 | make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 630 | |
Gilles Peskine | b1a977f | 2017-06-08 15:19:20 +0200 | [diff] [blame] | 631 | msg "build: arm-none-eabi-gcc -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s |
| 632 | cleanup |
Simon Butcher | 2c4d558 | 2017-07-23 13:42:36 +0200 | [diff] [blame] | 633 | cp "$CONFIG_H" "$CONFIG_BAK" |
Andres Amaya Garcia | 465db7e | 2017-07-20 13:27:35 +0100 | [diff] [blame] | 634 | scripts/config.pl full |
| 635 | scripts/config.pl unset MBEDTLS_NET_C |
| 636 | scripts/config.pl unset MBEDTLS_TIMING_C |
| 637 | scripts/config.pl unset MBEDTLS_FS_IO |
| 638 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
| 639 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY |
| 640 | # following things are not in the default config |
| 641 | scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c |
| 642 | scripts/config.pl unset MBEDTLS_THREADING_PTHREAD |
| 643 | scripts/config.pl unset MBEDTLS_THREADING_C |
| 644 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h |
| 645 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit |
Gilles Peskine | b1a977f | 2017-06-08 15:19:20 +0200 | [diff] [blame] | 646 | scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 647 | make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib |
Gilles Peskine | b1a977f | 2017-06-08 15:19:20 +0200 | [diff] [blame] | 648 | echo "Checking that software 64-bit division is not required" |
| 649 | ! grep __aeabi_uldiv library/*.o |
| 650 | |
Andres AG | 87bb577 | 2016-09-27 15:05:15 +0100 | [diff] [blame] | 651 | msg "build: ARM Compiler 5, make" |
Manuel Pégourié-Gonnard | c5c5939 | 2015-02-10 17:38:54 +0100 | [diff] [blame] | 652 | cleanup |
| 653 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 654 | scripts/config.pl full |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 655 | scripts/config.pl unset MBEDTLS_NET_C |
| 656 | scripts/config.pl unset MBEDTLS_TIMING_C |
| 657 | scripts/config.pl unset MBEDTLS_FS_IO |
Simon Butcher | 1c71965 | 2016-06-27 19:02:12 +0100 | [diff] [blame] | 658 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 659 | scripts/config.pl unset MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | bbc60db | 2015-06-22 14:31:50 +0200 | [diff] [blame] | 660 | scripts/config.pl unset MBEDTLS_HAVE_TIME_DATE |
Simon Butcher | bc6a486 | 2016-03-07 17:35:59 +0000 | [diff] [blame] | 661 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY |
Manuel Pégourié-Gonnard | c5c5939 | 2015-02-10 17:38:54 +0100 | [diff] [blame] | 662 | # following things are not in the default config |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 663 | scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING |
| 664 | scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c |
| 665 | scripts/config.pl unset MBEDTLS_THREADING_PTHREAD |
| 666 | scripts/config.pl unset MBEDTLS_THREADING_C |
| 667 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h |
| 668 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit |
Simon Butcher | 4df5eaf | 2016-08-24 22:58:31 +0300 | [diff] [blame] | 669 | scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT # depends on MBEDTLS_HAVE_TIME |
Andres AG | 87bb577 | 2016-09-27 15:05:15 +0100 | [diff] [blame] | 670 | |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 671 | if [ $RUN_ARMCC -ne 0 ]; then |
| 672 | make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib |
| 673 | make clean |
Andres AG | 87bb577 | 2016-09-27 15:05:15 +0100 | [diff] [blame] | 674 | |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 675 | # ARM Compiler 6 - Target ARMv7-A |
| 676 | armc6_build_test "--target=arm-arm-none-eabi -march=armv7-a" |
Simon Butcher | 2c4d558 | 2017-07-23 13:42:36 +0200 | [diff] [blame] | 677 | |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 678 | # ARM Compiler 6 - Target ARMv7-M |
| 679 | armc6_build_test "--target=arm-arm-none-eabi -march=armv7-m" |
Simon Butcher | 2c4d558 | 2017-07-23 13:42:36 +0200 | [diff] [blame] | 680 | |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 681 | # ARM Compiler 6 - Target ARMv8-A - AArch32 |
| 682 | armc6_build_test "--target=arm-arm-none-eabi -march=armv8.2-a" |
Simon Butcher | 2c4d558 | 2017-07-23 13:42:36 +0200 | [diff] [blame] | 683 | |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 684 | # ARM Compiler 6 - Target ARMv8-M |
| 685 | armc6_build_test "--target=arm-arm-none-eabi -march=armv8-m.main" |
Simon Butcher | 2c4d558 | 2017-07-23 13:42:36 +0200 | [diff] [blame] | 686 | |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 687 | # ARM Compiler 6 - Target ARMv8-A - AArch64 |
| 688 | armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a" |
| 689 | fi |
Manuel Pégourié-Gonnard | c5c5939 | 2015-02-10 17:38:54 +0100 | [diff] [blame] | 690 | |
Gilles Peskine | 2a458da | 2017-05-12 15:26:58 +0200 | [diff] [blame] | 691 | msg "build: allow SHA1 in certificates by default" |
| 692 | cleanup |
| 693 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 694 | scripts/config.pl set MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 695 | make CFLAGS='-Werror -Wall -Wextra' |
Gilles Peskine | 2a458da | 2017-05-12 15:26:58 +0200 | [diff] [blame] | 696 | msg "test: allow SHA1 in certificates by default" |
| 697 | make test |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 698 | if_build_succeeded tests/ssl-opt.sh -f SHA-1 |
Gilles Peskine | 2a458da | 2017-05-12 15:26:58 +0200 | [diff] [blame] | 699 | |
Simon Butcher | 002bc62 | 2016-11-17 09:27:45 +0000 | [diff] [blame] | 700 | msg "build: Windows cross build - mingw64, make (Link Library)" # ~ 30s |
Manuel Pégourié-Gonnard | 6448bce | 2015-02-16 17:18:36 +0100 | [diff] [blame] | 701 | cleanup |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 702 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 lib programs |
Simon Butcher | 91aef33 | 2016-11-17 09:20:50 +0000 | [diff] [blame] | 703 | |
Simon Butcher | 002bc62 | 2016-11-17 09:27:45 +0000 | [diff] [blame] | 704 | # note Make tests only builds the tests, but doesn't run them |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 705 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror' WINDOWS_BUILD=1 tests |
| 706 | make WINDOWS_BUILD=1 clean |
Simon Butcher | f95c176 | 2016-11-10 17:25:58 +0000 | [diff] [blame] | 707 | |
Simon Butcher | 002bc62 | 2016-11-17 09:27:45 +0000 | [diff] [blame] | 708 | msg "build: Windows cross build - mingw64, make (DLL)" # ~ 30s |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 709 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 lib programs |
| 710 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 tests |
| 711 | make WINDOWS_BUILD=1 clean |
Manuel Pégourié-Gonnard | 6448bce | 2015-02-16 17:18:36 +0100 | [diff] [blame] | 712 | |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 713 | # MemSan currently only available on Linux 64 bits |
| 714 | if uname -a | grep 'Linux.*x86_64' >/dev/null; then |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 715 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 716 | msg "build: MSan (clang)" # ~ 1 min 20s |
| 717 | cleanup |
| 718 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 719 | scripts/config.pl unset MBEDTLS_AESNI_C # memsan doesn't grok asm |
| 720 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan . |
| 721 | make |
Manuel Pégourié-Gonnard | 4a9dc2a | 2014-05-09 13:46:59 +0200 | [diff] [blame] | 722 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 723 | msg "test: main suites (MSan)" # ~ 10s |
| 724 | make test |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 725 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 726 | msg "test: ssl-opt.sh (MSan)" # ~ 1 min |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 727 | if_build_succeeded tests/ssl-opt.sh |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 728 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 729 | # Optional part(s) |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 730 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 731 | if [ "$MEMORY" -gt 0 ]; then |
| 732 | msg "test: compat.sh (MSan)" # ~ 6 min 20s |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 733 | if_build_succeeded tests/compat.sh |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 734 | fi |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 735 | |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 736 | else # no MemSan |
| 737 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 738 | msg "build: Release (clang)" |
| 739 | cleanup |
| 740 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release . |
| 741 | make |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 742 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 743 | msg "test: main suites valgrind (Release)" |
| 744 | make memcheck |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 745 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 746 | # Optional part(s) |
| 747 | # Currently broken, programs don't seem to receive signals |
| 748 | # under valgrind on OS X |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 749 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 750 | if [ "$MEMORY" -gt 0 ]; then |
| 751 | msg "test: ssl-opt.sh --memcheck (Release)" |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 752 | if_build_succeeded tests/ssl-opt.sh --memcheck |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 753 | fi |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 754 | |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 755 | if [ "$MEMORY" -gt 1 ]; then |
| 756 | msg "test: compat.sh --memcheck (Release)" |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 757 | if_build_succeeded tests/compat.sh --memcheck |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 758 | fi |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 759 | |
| 760 | fi # MemSan |
| 761 | |
Andres AG | dc19221 | 2016-08-31 17:33:13 +0100 | [diff] [blame] | 762 | msg "build: cmake 'out-of-source' build" |
| 763 | cleanup |
| 764 | MBEDTLS_ROOT_DIR="$PWD" |
| 765 | mkdir "$OUT_OF_SOURCE_DIR" |
| 766 | cd "$OUT_OF_SOURCE_DIR" |
| 767 | cmake "$MBEDTLS_ROOT_DIR" |
| 768 | make |
| 769 | |
| 770 | msg "test: cmake 'out-of-source' build" |
| 771 | make test |
| 772 | cd "$MBEDTLS_ROOT_DIR" |
| 773 | rm -rf "$OUT_OF_SOURCE_DIR" |
| 774 | |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 775 | msg "Done, cleaning up" |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 776 | cleanup |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 777 | |
| 778 | final_report |