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