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