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