Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 3 | # all.sh |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 4 | # |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 6 | # |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 7 | # Copyright (c) 2014-2016, ARM Limited, All Rights Reserved |
| 8 | # |
| 9 | # Purpose |
| 10 | # |
| 11 | # To run all tests possible or available on the platform. |
| 12 | # |
| 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. |
| 17 | # |
| 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 | |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +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 | |
| 25 | if [ -d library -a -d include -a -d tests ]; then :; else |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 26 | err_msg "Must be run from mbed TLS root" |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 27 | exit 1 |
| 28 | fi |
| 29 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 30 | CONFIG_H='include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 31 | CONFIG_BAK="$CONFIG_H.bak" |
| 32 | |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 33 | MEMORY=0 |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 34 | FORCE=0 |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 35 | KEEP_GOING=0 |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 36 | RELEASE=0 |
Gilles Peskine | b9344e3 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 37 | RUN_ARMCC=1 |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 38 | |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 39 | # Default commands, can be overriden by the environment |
| 40 | : ${OPENSSL:="openssl"} |
| 41 | : ${OPENSSL_LEGACY:="$OPENSSL"} |
| 42 | : ${GNUTLS_CLI:="gnutls-cli"} |
| 43 | : ${GNUTLS_SERV:="gnutls-serv"} |
| 44 | : ${GNUTLS_LEGACY_CLI:="$GNUTLS_CLI"} |
| 45 | : ${GNUTLS_LEGACY_SERV:="$GNUTLS_SERV"} |
| 46 | : ${OUT_OF_SOURCE_DIR:=./mbedtls_out_of_source_build} |
| 47 | |
| 48 | usage() |
| 49 | { |
Gilles Peskine | a6901f4 | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 50 | cat <<EOF |
| 51 | Usage: $0 [OPTION]... |
| 52 | -h|--help Print this help. |
| 53 | |
| 54 | General options: |
| 55 | -f|--force Force the tests to overwrite any modified files. |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 56 | -k|--keep-going Run all tests and report errors at the end. |
Gilles Peskine | a6901f4 | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 57 | -m|--memory Additional optional memory tests. |
Gilles Peskine | b9344e3 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 58 | --armcc Run ARM Compiler builds (on by default). |
| 59 | --no-armcc Skip ARM Compiler builds. |
Gilles Peskine | a6901f4 | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 60 | --out-of-source-dir=<path> Directory used for CMake out-of-source build tests. |
| 61 | -r|--release-test Run this script in release mode. This fixes the seed value to 1. |
| 62 | -s|--seed Integer seed value to use for this test run. |
| 63 | |
| 64 | Tool path options: |
| 65 | --gnutls-cli=<GnuTLS_cli_path> GnuTLS client executable to use for most tests. |
| 66 | --gnutls-serv=<GnuTLS_serv_path> GnuTLS server executable to use for most tests. |
| 67 | --gnutls-legacy-cli=<GnuTLS_cli_path> GnuTLS client executable to use for legacy tests. |
| 68 | --gnutls-legacy-serv=<GnuTLS_serv_path> GnuTLS server executable to use for legacy tests. |
| 69 | --openssl=<OpenSSL_path> OpenSSL executable to use for most tests. |
| 70 | --openssl-legacy=<OpenSSL_path> OpenSSL executable to use for legacy tests e.g. SSLv3. |
| 71 | EOF |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 72 | } |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 73 | |
| 74 | # remove built files as well as the cmake cache/config |
| 75 | cleanup() |
| 76 | { |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 77 | command make clean |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 78 | |
Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 79 | 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] | 80 | rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile |
Paul Bakker | fe0984d | 2014-06-13 00:13:45 +0200 | [diff] [blame] | 81 | git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile |
| 82 | git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 83 | |
| 84 | if [ -f "$CONFIG_BAK" ]; then |
| 85 | mv "$CONFIG_BAK" "$CONFIG_H" |
| 86 | fi |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 87 | } |
| 88 | |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 89 | # Executed on exit. May be redefined depending on command line options. |
| 90 | final_report () { |
| 91 | : |
| 92 | } |
| 93 | |
| 94 | fatal_signal () { |
| 95 | cleanup |
| 96 | final_report $1 |
| 97 | trap - $1 |
| 98 | kill -$1 $$ |
| 99 | } |
| 100 | |
| 101 | trap 'fatal_signal HUP' HUP |
| 102 | trap 'fatal_signal INT' INT |
| 103 | trap 'fatal_signal TERM' TERM |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 104 | |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 105 | msg() |
| 106 | { |
| 107 | echo "" |
| 108 | echo "******************************************************************" |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 109 | echo "* $1 " |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 110 | printf "* "; date |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 111 | echo "******************************************************************" |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 112 | current_section=$1 |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 113 | } |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 114 | |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 115 | err_msg() |
| 116 | { |
| 117 | echo "$1" >&2 |
| 118 | } |
| 119 | |
| 120 | check_tools() |
| 121 | { |
| 122 | for TOOL in "$@"; do |
| 123 | if ! `hash "$TOOL" >/dev/null 2>&1`; then |
| 124 | err_msg "$TOOL not found!" |
| 125 | exit 1 |
| 126 | fi |
| 127 | done |
| 128 | } |
| 129 | |
| 130 | while [ $# -gt 0 ]; do |
| 131 | case "$1" in |
Gilles Peskine | b9344e3 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 132 | --armcc) |
| 133 | RUN_ARMCC=1 |
| 134 | ;; |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 135 | --force|-f) |
| 136 | FORCE=1 |
| 137 | ;; |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 138 | --gnutls-cli) |
| 139 | shift |
| 140 | GNUTLS_CLI="$1" |
| 141 | ;; |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 142 | --gnutls-legacy-cli) |
| 143 | shift |
| 144 | GNUTLS_LEGACY_CLI="$1" |
| 145 | ;; |
| 146 | --gnutls-legacy-serv) |
| 147 | shift |
| 148 | GNUTLS_LEGACY_SERV="$1" |
| 149 | ;; |
Gilles Peskine | a6901f4 | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 150 | --gnutls-serv) |
| 151 | shift |
| 152 | GNUTLS_SERV="$1" |
| 153 | ;; |
| 154 | --help|-h) |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 155 | usage |
Gilles Peskine | a6901f4 | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 156 | exit |
| 157 | ;; |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 158 | --keep-going|-k) |
| 159 | KEEP_GOING=1 |
| 160 | ;; |
Gilles Peskine | a6901f4 | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 161 | --memory|-m) |
| 162 | MEMORY=1 |
| 163 | ;; |
Gilles Peskine | b9344e3 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 164 | --no-armcc) |
| 165 | RUN_ARMCC=0 |
| 166 | ;; |
Gilles Peskine | a6901f4 | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 167 | --openssl) |
| 168 | shift |
| 169 | OPENSSL="$1" |
| 170 | ;; |
| 171 | --openssl-legacy) |
| 172 | shift |
| 173 | OPENSSL_LEGACY="$1" |
| 174 | ;; |
| 175 | --out-of-source-dir) |
| 176 | shift |
| 177 | OUT_OF_SOURCE_DIR="$1" |
| 178 | ;; |
| 179 | --release-test|-r) |
| 180 | RELEASE=1 |
| 181 | ;; |
| 182 | --seed|-s) |
| 183 | shift |
| 184 | SEED="$1" |
| 185 | ;; |
| 186 | *) |
| 187 | echo >&2 "Unknown option: $1" |
| 188 | echo >&2 "Run $0 --help for usage." |
| 189 | exit 120 |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 190 | ;; |
| 191 | esac |
| 192 | shift |
| 193 | done |
| 194 | |
| 195 | if [ $FORCE -eq 1 ]; then |
| 196 | rm -rf yotta/module "$OUT_OF_SOURCE_DIR" |
| 197 | git checkout-index -f -q $CONFIG_H |
| 198 | cleanup |
| 199 | else |
| 200 | |
| 201 | if [ -d yotta/module ]; then |
| 202 | err_msg "Warning - there is an existing yotta module in the directory 'yotta/module'" |
| 203 | echo "You can either delete your work and retry, or force the test to overwrite the" |
| 204 | echo "test by rerunning the script as: $0 --force" |
| 205 | exit 1 |
| 206 | fi |
| 207 | |
| 208 | if [ -d "$OUT_OF_SOURCE_DIR" ]; then |
| 209 | echo "Warning - there is an existing directory at '$OUT_OF_SOURCE_DIR'" >&2 |
| 210 | echo "You can either delete this directory manually, or force the test by rerunning" |
| 211 | echo "the script as: $0 --force --out-of-source-dir $OUT_OF_SOURCE_DIR" |
| 212 | exit 1 |
| 213 | fi |
| 214 | |
| 215 | if ! git diff-files --quiet include/mbedtls/config.h; then |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 216 | err_msg "Warning - the configuration file 'include/mbedtls/config.h' has been edited. " |
| 217 | echo "You can either delete or preserve your work, or force the test by rerunning the" |
| 218 | echo "script as: $0 --force" |
| 219 | exit 1 |
| 220 | fi |
| 221 | fi |
| 222 | |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 223 | build_status=0 |
| 224 | if [ $KEEP_GOING -eq 1 ]; then |
| 225 | failure_summary= |
| 226 | failure_count=0 |
| 227 | start_red= |
| 228 | end_color= |
| 229 | if [ -t 1 ]; then |
| 230 | case "$TERM" in |
| 231 | *color*|cygwin|linux|rxvt*|screen|[Eex]term*) |
| 232 | start_red=$(printf '\033[31m') |
| 233 | end_color=$(printf '\033[0m') |
| 234 | ;; |
| 235 | esac |
| 236 | fi |
| 237 | record_status () { |
| 238 | if "$@"; then |
| 239 | last_status=0 |
| 240 | else |
| 241 | last_status=$? |
| 242 | text="$current_section: $* -> $last_status" |
| 243 | failure_summary="$failure_summary |
| 244 | $text" |
| 245 | failure_count=$((failure_count + 1)) |
| 246 | echo "${start_red}^^^^$text^^^^${end_color}" |
| 247 | fi |
| 248 | } |
| 249 | make () { |
| 250 | case "$*" in |
| 251 | *test|*check) |
| 252 | if [ $build_status -eq 0 ]; then |
| 253 | record_status command make "$@" |
| 254 | else |
| 255 | echo "(skipped because the build failed)" |
| 256 | fi |
| 257 | ;; |
| 258 | *) |
| 259 | record_status command make "$@" |
| 260 | build_status=$last_status |
| 261 | ;; |
| 262 | esac |
| 263 | } |
| 264 | final_report () { |
| 265 | if [ $failure_count -gt 0 ]; then |
| 266 | echo |
| 267 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
| 268 | echo "${start_red}FAILED: $failure_count${end_color}$failure_summary" |
| 269 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
| 270 | elif [ -z "${1-}" ]; then |
| 271 | echo "SUCCESS :)" |
| 272 | fi |
| 273 | if [ -n "${1-}" ]; then |
| 274 | echo "Killed by SIG$1." |
| 275 | fi |
| 276 | } |
| 277 | else |
| 278 | record_status () { |
| 279 | "$@" |
| 280 | } |
| 281 | fi |
| 282 | if_build_succeeded () { |
| 283 | if [ $build_status -eq 0 ]; then |
| 284 | record_status "$@" |
| 285 | fi |
| 286 | } |
| 287 | |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 288 | if [ $RELEASE -eq 1 ]; then |
| 289 | # Fix the seed value to 1 to ensure that the tests are deterministic. |
| 290 | SEED=1 |
| 291 | fi |
| 292 | |
| 293 | msg "info: $0 configuration" |
| 294 | echo "MEMORY: $MEMORY" |
| 295 | echo "FORCE: $FORCE" |
| 296 | echo "SEED: ${SEED-"UNSET"}" |
| 297 | echo "OPENSSL: $OPENSSL" |
| 298 | echo "OPENSSL_LEGACY: $OPENSSL_LEGACY" |
| 299 | echo "GNUTLS_CLI: $GNUTLS_CLI" |
| 300 | echo "GNUTLS_SERV: $GNUTLS_SERV" |
| 301 | echo "GNUTLS_LEGACY_CLI: $GNUTLS_LEGACY_CLI" |
| 302 | echo "GNUTLS_LEGACY_SERV: $GNUTLS_LEGACY_SERV" |
| 303 | |
| 304 | # To avoid setting OpenSSL and GnuTLS for each call to compat.sh and ssl-opt.sh |
| 305 | # we just export the variables they require |
| 306 | export OPENSSL_CMD="$OPENSSL" |
| 307 | export GNUTLS_CLI="$GNUTLS_CLI" |
| 308 | export GNUTLS_SERV="$GNUTLS_SERV" |
| 309 | |
| 310 | # Avoid passing --seed flag in every call to ssl-opt.sh |
| 311 | [ ! -z ${SEED+set} ] && export SEED |
| 312 | |
| 313 | # Make sure the tools we need are available. |
| 314 | check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$GNUTLS_CLI" "$GNUTLS_SERV" \ |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 315 | "$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV" "doxygen" "dot" \ |
Gilles Peskine | b9344e3 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 316 | "arm-none-eabi-gcc" |
| 317 | if [ $RUN_ARMCC -ne 0 ]; then |
| 318 | check_tools "armcc" |
| 319 | fi |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 320 | |
| 321 | # |
| 322 | # Test Suites to be executed |
| 323 | # |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 324 | # The test ordering tries to optimize for the following criteria: |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 325 | # 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] | 326 | # and/or are more likely to fail than others (eg I use Clang most of the |
| 327 | # time, so start with a GCC build). |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 328 | # 2. Minimize total running time, by avoiding useless rebuilds |
| 329 | # |
| 330 | # Indicative running times are given for reference. |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 331 | |
Manuel Pégourié-Gonnard | ea29d15 | 2014-11-20 17:32:33 +0100 | [diff] [blame] | 332 | msg "test: recursion.pl" # < 1s |
Manuel Pégourié-Gonnard | d09a6b5 | 2015-04-09 17:19:23 +0200 | [diff] [blame] | 333 | tests/scripts/recursion.pl library/*.c |
Manuel Pégourié-Gonnard | ea29d15 | 2014-11-20 17:32:33 +0100 | [diff] [blame] | 334 | |
Manuel Pégourié-Gonnard | b3b8e43 | 2015-02-13 14:52:19 +0000 | [diff] [blame] | 335 | msg "test: freshness of generated source files" # < 1s |
| 336 | tests/scripts/check-generated-files.sh |
| 337 | |
Manuel Pégourié-Gonnard | d09a6b5 | 2015-04-09 17:19:23 +0200 | [diff] [blame] | 338 | msg "test: doxygen markup outside doxygen blocks" # < 1s |
| 339 | tests/scripts/check-doxy-blocks.pl |
| 340 | |
Manuel Pégourié-Gonnard | a687baf | 2015-04-09 11:09:03 +0200 | [diff] [blame] | 341 | msg "test/build: declared and exported names" # < 3s |
| 342 | cleanup |
| 343 | tests/scripts/check-names.sh |
| 344 | |
Simon Butcher | 7315635 | 2015-11-04 00:36:30 +0000 | [diff] [blame] | 345 | # Yotta not supported in 2.1 branch |
| 346 | #msg "build: create and build yotta module" # ~ 30s |
| 347 | #cleanup |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 348 | #record_status tests/scripts/yotta-build.sh |
Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 349 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 350 | msg "build: cmake, gcc, ASan" # ~ 1 min 50s |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 351 | cleanup |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 352 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 353 | make |
| 354 | |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 355 | msg "test: main suites (inc. selftests) (ASan build)" # ~ 50s |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 356 | make test |
| 357 | programs/test/selftest |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 358 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 359 | msg "test: ssl-opt.sh (ASan build)" # ~ 1 min |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 360 | if_build_succeeded tests/ssl-opt.sh |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 361 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 362 | msg "test/build: ref-configs (ASan build)" # ~ 6 min 20s |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 363 | if_build_succeeded tests/scripts/test-ref-configs.pl |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 364 | |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 365 | msg "build: with ASan (rebuild after ref-configs)" # ~ 1 min |
| 366 | make |
| 367 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 368 | msg "test: compat.sh (ASan build)" # ~ 6 min |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 369 | if_build_succeeded tests/compat.sh |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 370 | |
Hanno Becker | 797c084 | 2017-10-19 15:49:21 +0100 | [diff] [blame] | 371 | msg "build: default config except MFL extension (ASan build)" # ~ 30s |
| 372 | cleanup |
| 373 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 374 | scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 375 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 376 | make |
| 377 | |
| 378 | msg "test: ssl-opt.sh, MFL-related tests" |
| 379 | tests/ssl-opt.sh -f "Max fragment length" |
| 380 | |
Simon Butcher | 02b8d48 | 2016-03-15 20:39:52 +0000 | [diff] [blame] | 381 | msg "build: Default + SSLv3 (ASan build)" # ~ 6 min |
| 382 | cleanup |
| 383 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 384 | scripts/config.pl set MBEDTLS_SSL_PROTO_SSL3 |
| 385 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 386 | make |
| 387 | |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 388 | msg "test: SSLv3 - main suites (inc. selftests) (ASan build)" # ~ 50s |
Simon Butcher | 02b8d48 | 2016-03-15 20:39:52 +0000 | [diff] [blame] | 389 | make test |
| 390 | programs/test/selftest |
| 391 | |
| 392 | msg "build: SSLv3 - compat.sh (ASan build)" # ~ 6 min |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 393 | if_build_succeeded tests/compat.sh -m 'tls1 tls1_1 tls1_2 dtls1 dtls1_2' |
| 394 | if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" tests/compat.sh -m 'ssl3' |
Simon Butcher | 02b8d48 | 2016-03-15 20:39:52 +0000 | [diff] [blame] | 395 | |
| 396 | msg "build: SSLv3 - ssl-opt.sh (ASan build)" # ~ 6 min |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 397 | if_build_succeeded tests/ssl-opt.sh |
Simon Butcher | 02b8d48 | 2016-03-15 20:39:52 +0000 | [diff] [blame] | 398 | |
Hanno Becker | 4f9973e | 2017-10-24 11:56:28 +0100 | [diff] [blame] | 399 | msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min |
| 400 | cleanup |
| 401 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 402 | scripts/config.pl unset MBEDTLS_SSL_RENEGOTIATION |
| 403 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 404 | make |
| 405 | |
| 406 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 407 | make test |
| 408 | |
| 409 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - ssl-opt.sh (ASan build)" # ~ 6 min |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 410 | if_build_succeeded tests/ssl-opt.sh |
Hanno Becker | 4f9973e | 2017-10-24 11:56:28 +0100 | [diff] [blame] | 411 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 412 | msg "build: cmake, full config, clang" # ~ 50s |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 413 | cleanup |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 414 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 415 | scripts/config.pl full |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 416 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 417 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check . |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 418 | make |
| 419 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 420 | msg "test: main suites (full config)" # ~ 5s |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 421 | make test |
| 422 | |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 423 | msg "test: ssl-opt.sh default (full config)" # ~ 1s |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 424 | if_build_succeeded tests/ssl-opt.sh -f Default |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 425 | |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 426 | msg "test: compat.sh RC4, DES & NULL (full config)" # ~ 2 min |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 427 | 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] | 428 | |
Manuel Pégourié-Gonnard | 134ca18 | 2015-10-23 09:04:45 +0200 | [diff] [blame] | 429 | msg "test/build: curves.pl (gcc)" # ~ 4 min |
Manuel Pégourié-Gonnard | 246978d | 2014-11-20 13:29:53 +0100 | [diff] [blame] | 430 | cleanup |
| 431 | cmake -D CMAKE_BUILD_TYPE:String=Debug . |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 432 | if_build_succeeded tests/scripts/curves.pl |
Manuel Pégourié-Gonnard | 246978d | 2014-11-20 13:29:53 +0100 | [diff] [blame] | 433 | |
Manuel Pégourié-Gonnard | 134ca18 | 2015-10-23 09:04:45 +0200 | [diff] [blame] | 434 | msg "test/build: key-exchanges (gcc)" # ~ 1 min |
| 435 | cleanup |
| 436 | cmake -D CMAKE_BUILD_TYPE:String=Check . |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 437 | if_build_succeeded tests/scripts/key-exchanges.pl |
Manuel Pégourié-Gonnard | 134ca18 | 2015-10-23 09:04:45 +0200 | [diff] [blame] | 438 | |
Manuel Pégourié-Gonnard | 61fe8b0 | 2015-03-13 14:33:16 +0000 | [diff] [blame] | 439 | msg "build: Unix make, -Os (gcc)" # ~ 30s |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 440 | cleanup |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 441 | make CC=gcc CFLAGS='-Werror -Os' |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 442 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 443 | # this is meant to cath missing #define mbedtls_printf etc |
Manuel Pégourié-Gonnard | 981732b | 2015-02-17 15:46:45 +0000 | [diff] [blame] | 444 | # disable fsio to catch some more missing #include <stdio.h> |
Manuel Pégourié-Gonnard | 757ca00 | 2015-03-23 15:24:07 +0100 | [diff] [blame] | 445 | msg "build: full config except platform/fsio, make, gcc" # ~ 30s |
Manuel Pégourié-Gonnard | a71780e | 2015-02-13 13:56:55 +0000 | [diff] [blame] | 446 | cleanup |
| 447 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 448 | scripts/config.pl full |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 449 | scripts/config.pl unset MBEDTLS_PLATFORM_C |
| 450 | scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY |
Manuel Pégourié-Gonnard | 3d4755b | 2015-06-03 14:03:17 +0100 | [diff] [blame] | 451 | scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT |
| 452 | scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT |
| 453 | scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT |
| 454 | scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 455 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 456 | scripts/config.pl unset MBEDTLS_FS_IO |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 457 | make CC=gcc CFLAGS='-Werror -O0' |
Manuel Pégourié-Gonnard | a71780e | 2015-02-13 13:56:55 +0000 | [diff] [blame] | 458 | |
Manuel Pégourié-Gonnard | dccb80b | 2015-06-03 10:20:33 +0100 | [diff] [blame] | 459 | # catch compile bugs in _uninit functions |
| 460 | msg "build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s |
| 461 | cleanup |
| 462 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 463 | scripts/config.pl full |
Manuel Pégourié-Gonnard | 7ee5ddd | 2015-06-03 10:33:55 +0100 | [diff] [blame] | 464 | scripts/config.pl set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 465 | make CC=gcc CFLAGS='-Werror -O0' |
Manuel Pégourié-Gonnard | dccb80b | 2015-06-03 10:20:33 +0100 | [diff] [blame] | 466 | |
Manuel Pégourié-Gonnard | 66b8e95 | 2015-05-20 11:13:56 +0200 | [diff] [blame] | 467 | msg "build: full config except ssl_srv.c, make, gcc" # ~ 30s |
| 468 | cleanup |
| 469 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 470 | scripts/config.pl full |
| 471 | scripts/config.pl unset MBEDTLS_SSL_SRV_C |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 472 | make CC=gcc CFLAGS='-Werror -O0' |
Manuel Pégourié-Gonnard | 66b8e95 | 2015-05-20 11:13:56 +0200 | [diff] [blame] | 473 | |
| 474 | msg "build: full config except ssl_cli.c, make, gcc" # ~ 30s |
| 475 | cleanup |
| 476 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 477 | scripts/config.pl full |
| 478 | scripts/config.pl unset MBEDTLS_SSL_CLI_C |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 479 | make CC=gcc CFLAGS='-Werror -O0' |
Manuel Pégourié-Gonnard | 66b8e95 | 2015-05-20 11:13:56 +0200 | [diff] [blame] | 480 | |
Manuel Pégourié-Gonnard | f78e4de | 2015-05-29 10:52:14 +0200 | [diff] [blame] | 481 | msg "build: full config except net.c, make, gcc -std=c99 -pedantic" # ~ 30s |
Manuel Pégourié-Gonnard | 009a264 | 2015-05-29 10:31:13 +0200 | [diff] [blame] | 482 | cleanup |
| 483 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 484 | scripts/config.pl full |
Manuel Pégourié-Gonnard | f78e4de | 2015-05-29 10:52:14 +0200 | [diff] [blame] | 485 | scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc. |
| 486 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 487 | make CC=gcc CFLAGS='-Werror -O0 -std=c99 -pedantic' lib |
Manuel Pégourié-Gonnard | 009a264 | 2015-05-29 10:31:13 +0200 | [diff] [blame] | 488 | |
Manuel Pégourié-Gonnard | 9b06abe | 2015-06-25 09:56:07 +0200 | [diff] [blame] | 489 | if uname -a | grep -F Linux >/dev/null; then |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 490 | msg "build/test: make shared" # ~ 40s |
| 491 | cleanup |
| 492 | make SHARED=1 all check |
Manuel Pégourié-Gonnard | 9b06abe | 2015-06-25 09:56:07 +0200 | [diff] [blame] | 493 | fi |
| 494 | |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 495 | if uname -a | grep -F x86_64 >/dev/null; then |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 496 | msg "build: i386, make, gcc" # ~ 30s |
| 497 | cleanup |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 498 | make CC=gcc CFLAGS='-Werror -m32' |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 499 | fi # x86_64 |
| 500 | |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 501 | msg "build: arm-none-eabi-gcc, make" # ~ 10s |
| 502 | cleanup |
| 503 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 504 | scripts/config.pl full |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 505 | scripts/config.pl unset MBEDTLS_NET_C |
| 506 | scripts/config.pl unset MBEDTLS_TIMING_C |
| 507 | scripts/config.pl unset MBEDTLS_FS_IO |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 508 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 509 | # following things are not in the default config |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 510 | scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c |
| 511 | scripts/config.pl unset MBEDTLS_THREADING_PTHREAD |
| 512 | scripts/config.pl unset MBEDTLS_THREADING_C |
| 513 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h |
| 514 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 515 | make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS=-Werror lib |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 516 | |
Gilles Peskine | b9344e3 | 2017-12-19 18:24:31 +0100 | [diff] [blame^] | 517 | if [ $RUN_ARMCC -ne 0 ]; then |
| 518 | msg "build: armcc, make" |
| 519 | cleanup |
| 520 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 521 | scripts/config.pl full |
| 522 | scripts/config.pl unset MBEDTLS_NET_C |
| 523 | scripts/config.pl unset MBEDTLS_TIMING_C |
| 524 | scripts/config.pl unset MBEDTLS_FS_IO |
| 525 | scripts/config.pl unset MBEDTLS_HAVE_TIME |
| 526 | scripts/config.pl unset MBEDTLS_HAVE_TIME_DATE |
| 527 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY |
| 528 | # following things are not in the default config |
| 529 | scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING |
| 530 | scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c |
| 531 | scripts/config.pl unset MBEDTLS_THREADING_PTHREAD |
| 532 | scripts/config.pl unset MBEDTLS_THREADING_C |
| 533 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h |
| 534 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit |
| 535 | make CC=armcc AR=armar WARNING_CFLAGS= lib |
| 536 | fi |
Manuel Pégourié-Gonnard | c5c5939 | 2015-02-10 17:38:54 +0100 | [diff] [blame] | 537 | |
Gilles Peskine | b49351d | 2017-05-12 15:26:58 +0200 | [diff] [blame] | 538 | msg "build: allow SHA1 in certificates by default" |
| 539 | cleanup |
| 540 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 541 | scripts/config.pl set MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 542 | make CFLAGS='-Werror -Wall -Wextra' |
Gilles Peskine | b49351d | 2017-05-12 15:26:58 +0200 | [diff] [blame] | 543 | msg "test: allow SHA1 in certificates by default" |
| 544 | make test |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 545 | if_build_succeeded tests/ssl-opt.sh -f SHA-1 |
Gilles Peskine | b49351d | 2017-05-12 15:26:58 +0200 | [diff] [blame] | 546 | |
Manuel Pégourié-Gonnard | 6448bce | 2015-02-16 17:18:36 +0100 | [diff] [blame] | 547 | if which i686-w64-mingw32-gcc >/dev/null; then |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 548 | msg "build: cross-mingw64, make" # ~ 30s |
| 549 | cleanup |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 550 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS=-Werror WINDOWS_BUILD=1 |
| 551 | make WINDOWS_BUILD=1 clean |
| 552 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS=-Werror WINDOWS_BUILD=1 SHARED=1 |
| 553 | make WINDOWS_BUILD=1 clean |
Manuel Pégourié-Gonnard | 6448bce | 2015-02-16 17:18:36 +0100 | [diff] [blame] | 554 | fi |
| 555 | |
Manuel Pégourié-Gonnard | edb2dc9 | 2015-02-10 14:36:31 +0000 | [diff] [blame] | 556 | # MemSan currently only available on Linux 64 bits |
| 557 | if uname -a | grep 'Linux.*x86_64' >/dev/null; then |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 558 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 559 | msg "build: MSan (clang)" # ~ 1 min 20s |
| 560 | cleanup |
| 561 | cp "$CONFIG_H" "$CONFIG_BAK" |
| 562 | scripts/config.pl unset MBEDTLS_AESNI_C # memsan doesn't grok asm |
| 563 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan . |
| 564 | make |
Manuel Pégourié-Gonnard | 4a9dc2a | 2014-05-09 13:46:59 +0200 | [diff] [blame] | 565 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 566 | msg "test: main suites (MSan)" # ~ 10s |
| 567 | make test |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 568 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 569 | msg "test: ssl-opt.sh (MSan)" # ~ 1 min |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 570 | if_build_succeeded tests/ssl-opt.sh |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 571 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 572 | # Optional part(s) |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 573 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 574 | if [ "$MEMORY" -gt 0 ]; then |
| 575 | msg "test: compat.sh (MSan)" # ~ 6 min 20s |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 576 | if_build_succeeded tests/compat.sh |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 577 | fi |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 578 | |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 579 | else # no MemSan |
| 580 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 581 | msg "build: Release (clang)" |
| 582 | cleanup |
| 583 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release . |
| 584 | make |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 585 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 586 | msg "test: main suites valgrind (Release)" |
| 587 | make memcheck |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 588 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 589 | # Optional part(s) |
| 590 | # Currently broken, programs don't seem to receive signals |
| 591 | # under valgrind on OS X |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 592 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 593 | if [ "$MEMORY" -gt 0 ]; then |
| 594 | msg "test: ssl-opt.sh --memcheck (Release)" |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 595 | if_build_succeeded tests/ssl-opt.sh --memcheck |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 596 | fi |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 597 | |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 598 | if [ "$MEMORY" -gt 1 ]; then |
| 599 | msg "test: compat.sh --memcheck (Release)" |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 600 | if_build_succeeded tests/compat.sh --memcheck |
Gilles Peskine | 30dfbaf | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 601 | fi |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 602 | |
| 603 | fi # MemSan |
| 604 | |
Simon Butcher | d7f1902 | 2016-10-14 09:49:48 +0100 | [diff] [blame] | 605 | msg "build: cmake 'out-of-source' build" |
| 606 | cleanup |
| 607 | MBEDTLS_ROOT_DIR="$PWD" |
| 608 | mkdir "$OUT_OF_SOURCE_DIR" |
| 609 | cd "$OUT_OF_SOURCE_DIR" |
| 610 | cmake "$MBEDTLS_ROOT_DIR" |
| 611 | make |
| 612 | |
| 613 | msg "test: cmake 'out-of-source' build" |
| 614 | make test |
| 615 | cd "$MBEDTLS_ROOT_DIR" |
| 616 | rm -rf "$OUT_OF_SOURCE_DIR" |
| 617 | |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 618 | msg "Done, cleaning up" |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 619 | cleanup |
Gilles Peskine | a8bf986 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 620 | |
| 621 | final_report |