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