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 | # |
Gilles Peskine | 192c72f | 2017-12-21 15:59:21 +0100 | [diff] [blame] | 7 | # Copyright (c) 2014-2017, ARM Limited, All Rights Reserved |
| 8 | |
| 9 | |
| 10 | |
| 11 | ################################################################ |
| 12 | #### Documentation |
| 13 | ################################################################ |
| 14 | |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 15 | # Purpose |
Gilles Peskine | 192c72f | 2017-12-21 15:59:21 +0100 | [diff] [blame] | 16 | # ------- |
Simon Butcher | 3ea7f52 | 2016-03-07 23:22:10 +0000 | [diff] [blame] | 17 | # |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 18 | # To run all tests possible or available on the platform. |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 19 | # |
Gilles Peskine | 192c72f | 2017-12-21 15:59:21 +0100 | [diff] [blame] | 20 | # Notes for users |
| 21 | # --------------- |
| 22 | # |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 23 | # Warning: the test is destructive. It includes various build modes and |
| 24 | # configurations, and can and will arbitrarily change the current CMake |
Gilles Peskine | 192c72f | 2017-12-21 15:59:21 +0100 | [diff] [blame] | 25 | # configuration. The following files must be committed into git: |
| 26 | # * include/mbedtls/config.h |
| 27 | # * Makefile, library/Makefile, programs/Makefile, tests/Makefile |
| 28 | # After running this script, the CMake cache will be lost and CMake |
| 29 | # will no longer be initialised. |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 30 | # |
Gilles Peskine | 192c72f | 2017-12-21 15:59:21 +0100 | [diff] [blame] | 31 | # The script assumes the presence of a number of tools: |
| 32 | # * Basic Unix tools (Windows users note: a Unix-style find must be before |
| 33 | # the Windows find in the PATH) |
| 34 | # * Perl |
| 35 | # * GNU Make |
| 36 | # * CMake |
| 37 | # * GCC and Clang (recent enough for using ASan with gcc and MemSan with clang, or valgrind) |
| 38 | # * arm-gcc and mingw-gcc |
| 39 | # * ArmCC 5 and ArmCC 6, unless invoked with --no-armcc |
| 40 | # * Yotta build dependencies, unless invoked with --no-yotta |
| 41 | # * OpenSSL and GnuTLS command line tools, recent enough for the |
| 42 | # interoperability tests. If they don't support SSLv3 then a legacy |
| 43 | # version of these tools must be present as well (search for LEGACY |
| 44 | # below). |
| 45 | # See the invocation of check_tools below for details. |
| 46 | # |
| 47 | # This script must be invoked from the toplevel directory of a git |
| 48 | # working copy of Mbed TLS. |
| 49 | # |
| 50 | # Note that the output is not saved. You may want to run |
| 51 | # script -c tests/scripts/all.sh |
| 52 | # or |
| 53 | # tests/scripts/all.sh >all.log 2>&1 |
| 54 | # |
| 55 | # Notes for maintainers |
| 56 | # --------------------- |
| 57 | # |
| 58 | # The tests are roughly in order from fastest to slowest. This doesn't |
| 59 | # have to be exact, but in general you should add slower tests towards |
| 60 | # the end and fast checks near the beginning. |
| 61 | # |
| 62 | # Sanity checks have the following form: |
| 63 | # 1. msg "short description of what is about to be done" |
| 64 | # 2. run sanity check (failure stops the script) |
| 65 | # |
| 66 | # Build or build-and-test steps have the following form: |
| 67 | # 1. msg "short description of what is about to be done" |
| 68 | # 2. cleanup |
| 69 | # 3. preparation (config.pl, cmake, ...) (failure stops the script) |
| 70 | # 4. make |
| 71 | # 5. Run tests if relevant. All tests must be prefixed with |
| 72 | # if_build_successful for the sake of --keep-going. |
| 73 | |
| 74 | |
| 75 | |
| 76 | ################################################################ |
| 77 | #### Initialization and command line parsing |
| 78 | ################################################################ |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 79 | |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 80 | # Abort on errors (and uninitialised variables) |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 81 | set -eu |
| 82 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 83 | pre_check_environment () { |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 84 | if [ -d library -a -d include -a -d tests ]; then :; else |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 85 | echo "Must be run from mbed TLS root" >&2 |
| 86 | exit 1 |
| 87 | fi |
| 88 | } |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 89 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 90 | pre_initialize_variables () { |
| 91 | CONFIG_H='include/mbedtls/config.h' |
| 92 | CONFIG_BAK="$CONFIG_H.bak" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 93 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 94 | MEMORY=0 |
| 95 | FORCE=0 |
| 96 | KEEP_GOING=0 |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 97 | YOTTA=1 |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 98 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 99 | # Default commands, can be overriden by the environment |
| 100 | : ${OPENSSL:="openssl"} |
| 101 | : ${OPENSSL_LEGACY:="$OPENSSL"} |
| 102 | : ${GNUTLS_CLI:="gnutls-cli"} |
| 103 | : ${GNUTLS_SERV:="gnutls-serv"} |
| 104 | : ${GNUTLS_LEGACY_CLI:="$GNUTLS_CLI"} |
| 105 | : ${GNUTLS_LEGACY_SERV:="$GNUTLS_SERV"} |
| 106 | : ${OUT_OF_SOURCE_DIR:=./mbedtls_out_of_source_build} |
| 107 | : ${ARMC5_BIN_DIR:=/usr/bin} |
| 108 | : ${ARMC6_BIN_DIR:=/usr/bin} |
Andres AG | dc19221 | 2016-08-31 17:33:13 +0100 | [diff] [blame] | 109 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 110 | # if MAKEFLAGS is not set add the -j option to speed up invocations of make |
Gilles Peskine | 7120f77 | 2019-01-06 20:15:26 +0000 | [diff] [blame] | 111 | if [ -z "${MAKEFLAGS+set}" ]; then |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 112 | export MAKEFLAGS="-j" |
| 113 | fi |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 114 | |
| 115 | # Gather the list of available components. These are the functions |
| 116 | # defined in this script whose name starts with "component_". |
| 117 | # Parse the script with sed, because in sh there is no way to list |
| 118 | # defined functions. |
| 119 | ALL_COMPONENTS=$(sed -n 's/^ *component_\([0-9A-Z_a-z]*\) *().*/\1/p' <"$0") |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 120 | |
| 121 | # Exclude components that are not supported on this platform. |
| 122 | SUPPORTED_COMPONENTS= |
| 123 | for component in $ALL_COMPONENTS; do |
| 124 | case $(type "support_$component" 2>&1) in |
| 125 | *' function'*) |
| 126 | if ! support_$component; then continue; fi;; |
| 127 | esac |
| 128 | SUPPORTED_COMPONENTS="$SUPPORTED_COMPONENTS $component" |
| 129 | done |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 130 | } |
Andres AG | 38495a3 | 2016-07-12 16:54:33 +0100 | [diff] [blame] | 131 | |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 132 | # Test whether $1 is excluded via the command line. |
Gilles Peskine | 6e98423 | 2018-11-27 21:37:53 +0100 | [diff] [blame] | 133 | is_component_excluded() |
| 134 | { |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 135 | # Is $1 excluded via $COMPONENTS (a space-separated list of wildcard |
| 136 | # patterns)? |
Gilles Peskine | 6e98423 | 2018-11-27 21:37:53 +0100 | [diff] [blame] | 137 | set -f |
Gilles Peskine | eb39b9b | 2019-01-08 23:41:00 +0100 | [diff] [blame] | 138 | for pattern in $COMMAND_LINE_COMPONENTS; do |
Gilles Peskine | 6e98423 | 2018-11-27 21:37:53 +0100 | [diff] [blame] | 139 | set +f |
| 140 | case ${1#component_} in $pattern) return 0;; esac |
| 141 | done |
| 142 | set +f |
| 143 | return 1 |
| 144 | } |
| 145 | |
Simon Butcher | 41eeccf | 2016-09-07 00:07:09 +0100 | [diff] [blame] | 146 | usage() |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 147 | { |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 148 | cat <<EOF |
Gilles Peskine | 91bd8b7 | 2019-01-08 23:01:34 +0100 | [diff] [blame] | 149 | Usage: $0 [OPTION]... [COMPONENT]... |
| 150 | Run mbedtls release validation tests. |
| 151 | By default, run all tests. With one or more COMPONENT, run only those. |
| 152 | |
| 153 | Special options: |
| 154 | -h|--help Print this help and exit. |
Gilles Peskine | b3241cb | 2019-01-08 23:44:07 +0100 | [diff] [blame] | 155 | --list-all-components List all available test components and exit. |
| 156 | --list-components List components supported on this platform and exit. |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 157 | |
| 158 | General options: |
| 159 | -f|--force Force the tests to overwrite any modified files. |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 160 | -k|--keep-going Run all tests and report errors at the end. |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 161 | -m|--memory Additional optional memory tests. |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame] | 162 | --armcc Run ARM Compiler builds (on by default). |
Gilles Peskine | 6e98423 | 2018-11-27 21:37:53 +0100 | [diff] [blame] | 163 | --except If some components are passed on the command line, |
| 164 | run all the tests except for these components. In |
| 165 | this mode, you can pass shell wildcard patterns as |
| 166 | component names, e.g. "$0 --except 'test_*'" to |
| 167 | exclude all components that run tests. |
Gilles Peskine | bca6ab9 | 2017-12-19 18:24:31 +0100 | [diff] [blame] | 168 | --no-armcc Skip ARM Compiler builds. |
Gilles Peskine | 19ceb71 | 2018-03-21 08:40:26 +0100 | [diff] [blame] | 169 | --no-force Refuse to overwrite modified files (default). |
| 170 | --no-keep-going Stop at the first error (default). |
| 171 | --no-memory No additional memory tests (default). |
Gilles Peskine | 2a22a80 | 2017-12-21 15:19:00 +0100 | [diff] [blame] | 172 | --no-yotta Skip yotta module build. |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 173 | --out-of-source-dir=<path> Directory used for CMake out-of-source build tests. |
Gilles Peskine | 19ceb71 | 2018-03-21 08:40:26 +0100 | [diff] [blame] | 174 | --random-seed Use a random seed value for randomized tests (default). |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 175 | -r|--release-test Run this script in release mode. This fixes the seed value to 1. |
| 176 | -s|--seed Integer seed value to use for this test run. |
Gilles Peskine | 2a22a80 | 2017-12-21 15:19:00 +0100 | [diff] [blame] | 177 | --yotta Build yotta module (on by default). |
Gilles Peskine | 709346a | 2017-12-10 23:43:39 +0100 | [diff] [blame] | 178 | |
| 179 | Tool path options: |
| 180 | --armc5-bin-dir=<ARMC5_bin_dir_path> ARM Compiler 5 bin directory. |
| 181 | --armc6-bin-dir=<ARMC6_bin_dir_path> ARM Compiler 6 bin directory. |
| 182 | --gnutls-cli=<GnuTLS_cli_path> GnuTLS client executable to use for most tests. |
| 183 | --gnutls-serv=<GnuTLS_serv_path> GnuTLS server executable to use for most tests. |
| 184 | --gnutls-legacy-cli=<GnuTLS_cli_path> GnuTLS client executable to use for legacy tests. |
| 185 | --gnutls-legacy-serv=<GnuTLS_serv_path> GnuTLS server executable to use for legacy tests. |
| 186 | --openssl=<OpenSSL_path> OpenSSL executable to use for most tests. |
| 187 | --openssl-legacy=<OpenSSL_path> OpenSSL executable to use for legacy tests e.g. SSLv3. |
| 188 | EOF |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 189 | } |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 190 | |
| 191 | # remove built files as well as the cmake cache/config |
| 192 | cleanup() |
| 193 | { |
Gilles Peskine | a71d64c | 2018-03-21 12:16:57 +0100 | [diff] [blame] | 194 | if [ -n "${MBEDTLS_ROOT_DIR+set}" ]; then |
| 195 | cd "$MBEDTLS_ROOT_DIR" |
| 196 | fi |
| 197 | |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 198 | command make clean |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 199 | |
Gilles Peskine | 31b07e2 | 2018-03-21 12:15:06 +0100 | [diff] [blame] | 200 | # Remove CMake artefacts |
| 201 | find . -name .git -prune -o -name yotta -prune -o \ |
| 202 | -iname CMakeFiles -exec rm -rf {} \+ -o \ |
| 203 | \( -iname cmake_install.cmake -o \ |
| 204 | -iname CTestTestfile.cmake -o \ |
| 205 | -iname CMakeCache.txt \) -exec rm {} \+ |
| 206 | # Recover files overwritten by in-tree CMake builds |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 207 | rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile |
Paul Bakker | fe0984d | 2014-06-13 00:13:45 +0200 | [diff] [blame] | 208 | git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile |
| 209 | git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 210 | |
| 211 | if [ -f "$CONFIG_BAK" ]; then |
| 212 | mv "$CONFIG_BAK" "$CONFIG_H" |
| 213 | fi |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 214 | } |
| 215 | |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 216 | # Executed on exit. May be redefined depending on command line options. |
| 217 | final_report () { |
| 218 | : |
| 219 | } |
| 220 | |
| 221 | fatal_signal () { |
| 222 | cleanup |
| 223 | final_report $1 |
| 224 | trap - $1 |
| 225 | kill -$1 $$ |
| 226 | } |
| 227 | |
| 228 | trap 'fatal_signal HUP' HUP |
| 229 | trap 'fatal_signal INT' INT |
| 230 | trap 'fatal_signal TERM' TERM |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 231 | |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 232 | msg() |
| 233 | { |
Gilles Peskine | 11ddca6 | 2018-12-04 12:49:28 +0100 | [diff] [blame] | 234 | if [ -n "${current_component:-}" ]; then |
| 235 | current_section="${current_component#component_}: $1" |
| 236 | else |
| 237 | current_section="$1" |
| 238 | fi |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 239 | echo "" |
| 240 | echo "******************************************************************" |
Gilles Peskine | 11ddca6 | 2018-12-04 12:49:28 +0100 | [diff] [blame] | 241 | echo "* $current_section " |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 242 | printf "* "; date |
Manuel Pégourié-Gonnard | 3895f5a | 2014-03-27 14:44:04 +0100 | [diff] [blame] | 243 | echo "******************************************************************" |
| 244 | } |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 245 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 246 | armc6_build_test() |
| 247 | { |
| 248 | FLAGS="$1" |
Andres AG | a5cd973 | 2016-10-17 15:23:10 +0100 | [diff] [blame] | 249 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 250 | msg "build: ARM Compiler 6 ($FLAGS), make" |
| 251 | ARM_TOOL_VARIANT="ult" CC="$ARMC6_CC" AR="$ARMC6_AR" CFLAGS="$FLAGS" \ |
| 252 | WARNING_CFLAGS='-xc -std=c99' make lib |
| 253 | make clean |
| 254 | } |
Andres AG | a5cd973 | 2016-10-17 15:23:10 +0100 | [diff] [blame] | 255 | |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 256 | err_msg() |
| 257 | { |
| 258 | echo "$1" >&2 |
| 259 | } |
| 260 | |
| 261 | check_tools() |
| 262 | { |
| 263 | for TOOL in "$@"; do |
Andres AG | 9839360 | 2017-01-31 17:04:45 +0000 | [diff] [blame] | 264 | if ! `type "$TOOL" >/dev/null 2>&1`; then |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 265 | err_msg "$TOOL not found!" |
| 266 | exit 1 |
| 267 | fi |
| 268 | done |
| 269 | } |
| 270 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 271 | pre_parse_command_line () { |
Gilles Peskine | eb39b9b | 2019-01-08 23:41:00 +0100 | [diff] [blame] | 272 | COMMAND_LINE_COMPONENTS= |
| 273 | all_except= |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 274 | no_armcc= |
Gilles Peskine | 6e98423 | 2018-11-27 21:37:53 +0100 | [diff] [blame] | 275 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 276 | while [ $# -gt 0 ]; do |
| 277 | case "$1" in |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 278 | --armcc) no_armcc=;; |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 279 | --armc5-bin-dir) shift; ARMC5_BIN_DIR="$1";; |
| 280 | --armc6-bin-dir) shift; ARMC6_BIN_DIR="$1";; |
Gilles Peskine | eb39b9b | 2019-01-08 23:41:00 +0100 | [diff] [blame] | 281 | --except) all_except=1;; |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 282 | --force|-f) FORCE=1;; |
| 283 | --gnutls-cli) shift; GNUTLS_CLI="$1";; |
| 284 | --gnutls-legacy-cli) shift; GNUTLS_LEGACY_CLI="$1";; |
| 285 | --gnutls-legacy-serv) shift; GNUTLS_LEGACY_SERV="$1";; |
| 286 | --gnutls-serv) shift; GNUTLS_SERV="$1";; |
| 287 | --help|-h) usage; exit;; |
| 288 | --keep-going|-k) KEEP_GOING=1;; |
Gilles Peskine | b3241cb | 2019-01-08 23:44:07 +0100 | [diff] [blame] | 289 | --list-all-components) printf '%s\n' $ALL_COMPONENTS; exit;; |
| 290 | --list-components) printf '%s\n' $SUPPORTED_COMPONENTS; exit;; |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 291 | --memory|-m) MEMORY=1;; |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 292 | --no-armcc) no_armcc=1;; |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 293 | --no-force) FORCE=0;; |
| 294 | --no-keep-going) KEEP_GOING=0;; |
| 295 | --no-memory) MEMORY=0;; |
| 296 | --no-yotta) YOTTA=0;; |
| 297 | --openssl) shift; OPENSSL="$1";; |
| 298 | --openssl-legacy) shift; OPENSSL_LEGACY="$1";; |
| 299 | --out-of-source-dir) shift; OUT_OF_SOURCE_DIR="$1";; |
| 300 | --random-seed) unset SEED;; |
| 301 | --release-test|-r) SEED=1;; |
| 302 | --seed|-s) shift; SEED="$1";; |
| 303 | --yotta) YOTTA=1;; |
Gilles Peskine | 91bd8b7 | 2019-01-08 23:01:34 +0100 | [diff] [blame] | 304 | -*) |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 305 | echo >&2 "Unknown option: $1" |
| 306 | echo >&2 "Run $0 --help for usage." |
| 307 | exit 120 |
| 308 | ;; |
Gilles Peskine | eb39b9b | 2019-01-08 23:41:00 +0100 | [diff] [blame] | 309 | *) COMMAND_LINE_COMPONENTS="$COMMAND_LINE_COMPONENTS $1";; |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 310 | esac |
| 311 | shift |
| 312 | done |
Gilles Peskine | 91bd8b7 | 2019-01-08 23:01:34 +0100 | [diff] [blame] | 313 | |
Gilles Peskine | eb39b9b | 2019-01-08 23:41:00 +0100 | [diff] [blame] | 314 | if [ -z "$COMMAND_LINE_COMPONENTS" ]; then |
| 315 | all_except=1 |
| 316 | fi |
| 317 | |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 318 | # --no-armcc is a legacy option. The modern way is --except '*_armcc*'. |
| 319 | # Ignore it if components are listed explicitly on the command line. |
| 320 | if [ -n "$no_armcc" ] && [ -n "$all_except" ]; then |
| 321 | COMMAND_LINE_COMPONENTS="$COMMAND_LINE_COMPONENTS *_armcc*" |
| 322 | # --no-armcc also disables yotta. |
| 323 | COMMAND_LINE_COMPONENTS="$COMMAND_LINE_COMPONENTS *_yotta*" |
| 324 | fi |
| 325 | |
Gilles Peskine | eb39b9b | 2019-01-08 23:41:00 +0100 | [diff] [blame] | 326 | # Build the list of components to run. |
| 327 | if [ -n "$all_except" ]; then |
Gilles Peskine | 6e98423 | 2018-11-27 21:37:53 +0100 | [diff] [blame] | 328 | RUN_COMPONENTS= |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 329 | for component in $SUPPORTED_COMPONENTS; do |
Gilles Peskine | 6e98423 | 2018-11-27 21:37:53 +0100 | [diff] [blame] | 330 | if ! is_component_excluded "$component"; then |
| 331 | RUN_COMPONENTS="$RUN_COMPONENTS $component" |
| 332 | fi |
| 333 | done |
Gilles Peskine | 6e98423 | 2018-11-27 21:37:53 +0100 | [diff] [blame] | 334 | else |
Gilles Peskine | eb39b9b | 2019-01-08 23:41:00 +0100 | [diff] [blame] | 335 | RUN_COMPONENTS="$COMMAND_LINE_COMPONENTS" |
Gilles Peskine | 91bd8b7 | 2019-01-08 23:01:34 +0100 | [diff] [blame] | 336 | fi |
Gilles Peskine | eb39b9b | 2019-01-08 23:41:00 +0100 | [diff] [blame] | 337 | |
| 338 | unset all_except |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 339 | unset no_armcc |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 340 | } |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 341 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 342 | pre_check_git () { |
| 343 | if [ $FORCE -eq 1 ]; then |
| 344 | if [ $YOTTA -eq 1 ]; then |
| 345 | rm -rf yotta/module "$OUT_OF_SOURCE_DIR" |
| 346 | fi |
| 347 | git checkout-index -f -q $CONFIG_H |
| 348 | cleanup |
| 349 | else |
| 350 | |
| 351 | if [ $YOTTA -ne 0 ] && [ -d yotta/module ]; then |
| 352 | err_msg "Warning - there is an existing yotta module in the directory 'yotta/module'" |
| 353 | echo "You can either delete your work and retry, or force the test to overwrite the" |
| 354 | echo "test by rerunning the script as: $0 --force" |
| 355 | exit 1 |
| 356 | fi |
| 357 | |
| 358 | if [ -d "$OUT_OF_SOURCE_DIR" ]; then |
| 359 | echo "Warning - there is an existing directory at '$OUT_OF_SOURCE_DIR'" >&2 |
| 360 | echo "You can either delete this directory manually, or force the test by rerunning" |
| 361 | echo "the script as: $0 --force --out-of-source-dir $OUT_OF_SOURCE_DIR" |
| 362 | exit 1 |
| 363 | fi |
| 364 | |
| 365 | if ! git diff-files --quiet include/mbedtls/config.h; then |
| 366 | err_msg "Warning - the configuration file 'include/mbedtls/config.h' has been edited. " |
| 367 | echo "You can either delete or preserve your work, or force the test by rerunning the" |
| 368 | echo "script as: $0 --force" |
| 369 | exit 1 |
| 370 | fi |
Gilles Peskine | da51925 | 2017-11-30 13:22:04 +0100 | [diff] [blame] | 371 | fi |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 372 | } |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 373 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 374 | pre_setup_keep_going () { |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 375 | failure_summary= |
| 376 | failure_count=0 |
| 377 | start_red= |
| 378 | end_color= |
| 379 | if [ -t 1 ]; then |
Gilles Peskine | 9736b9d | 2018-01-02 21:54:17 +0100 | [diff] [blame] | 380 | case "${TERM:-}" in |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 381 | *color*|cygwin|linux|rxvt*|screen|[Eex]term*) |
| 382 | start_red=$(printf '\033[31m') |
| 383 | end_color=$(printf '\033[0m') |
| 384 | ;; |
| 385 | esac |
| 386 | fi |
| 387 | record_status () { |
| 388 | if "$@"; then |
| 389 | last_status=0 |
| 390 | else |
| 391 | last_status=$? |
| 392 | text="$current_section: $* -> $last_status" |
| 393 | failure_summary="$failure_summary |
| 394 | $text" |
| 395 | failure_count=$((failure_count + 1)) |
| 396 | echo "${start_red}^^^^$text^^^^${end_color}" |
| 397 | fi |
| 398 | } |
| 399 | make () { |
| 400 | case "$*" in |
| 401 | *test|*check) |
| 402 | if [ $build_status -eq 0 ]; then |
| 403 | record_status command make "$@" |
| 404 | else |
| 405 | echo "(skipped because the build failed)" |
| 406 | fi |
| 407 | ;; |
| 408 | *) |
| 409 | record_status command make "$@" |
| 410 | build_status=$last_status |
| 411 | ;; |
| 412 | esac |
| 413 | } |
| 414 | final_report () { |
| 415 | if [ $failure_count -gt 0 ]; then |
| 416 | echo |
| 417 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
| 418 | echo "${start_red}FAILED: $failure_count${end_color}$failure_summary" |
| 419 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
Jaeden Amero | 5113bde | 2018-07-20 16:42:14 +0100 | [diff] [blame] | 420 | exit 1 |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 421 | elif [ -z "${1-}" ]; then |
| 422 | echo "SUCCESS :)" |
| 423 | fi |
| 424 | if [ -n "${1-}" ]; then |
| 425 | echo "Killed by SIG$1." |
| 426 | fi |
| 427 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 428 | } |
| 429 | |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 430 | if_build_succeeded () { |
| 431 | if [ $build_status -eq 0 ]; then |
| 432 | record_status "$@" |
| 433 | fi |
| 434 | } |
| 435 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 436 | pre_print_configuration () { |
| 437 | msg "info: $0 configuration" |
| 438 | echo "MEMORY: $MEMORY" |
| 439 | echo "FORCE: $FORCE" |
| 440 | echo "SEED: ${SEED-"UNSET"}" |
| 441 | echo "OPENSSL: $OPENSSL" |
| 442 | echo "OPENSSL_LEGACY: $OPENSSL_LEGACY" |
| 443 | echo "GNUTLS_CLI: $GNUTLS_CLI" |
| 444 | echo "GNUTLS_SERV: $GNUTLS_SERV" |
| 445 | echo "GNUTLS_LEGACY_CLI: $GNUTLS_LEGACY_CLI" |
| 446 | echo "GNUTLS_LEGACY_SERV: $GNUTLS_LEGACY_SERV" |
| 447 | echo "ARMC5_BIN_DIR: $ARMC5_BIN_DIR" |
| 448 | echo "ARMC6_BIN_DIR: $ARMC6_BIN_DIR" |
| 449 | } |
Andres AG | 7770ea8 | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 450 | |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 451 | # Make sure the tools we need are available. |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 452 | pre_check_tools () { |
Gilles Peskine | 541fb1e | 2019-01-06 22:40:00 +0000 | [diff] [blame^] | 453 | # Build the list of variables to pass to output_env.sh. |
| 454 | set env |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 455 | |
Gilles Peskine | 541fb1e | 2019-01-06 22:40:00 +0000 | [diff] [blame^] | 456 | case " $RUN_COMPONENTS " in |
| 457 | # Require OpenSSL and GnuTLS if running any tests (as opposed to |
| 458 | # only doing builds). Not all tests run OpenSSL and GnuTLS, but this |
| 459 | # is a good enough approximation in practice. |
| 460 | *" test_"*) |
| 461 | # To avoid setting OpenSSL and GnuTLS for each call to compat.sh |
| 462 | # and ssl-opt.sh, we just export the variables they require. |
| 463 | export OPENSSL_CMD="$OPENSSL" |
| 464 | export GNUTLS_CLI="$GNUTLS_CLI" |
| 465 | export GNUTLS_SERV="$GNUTLS_SERV" |
| 466 | # Avoid passing --seed flag in every call to ssl-opt.sh |
| 467 | if [ -n "${SEED-}" ]; then |
| 468 | export SEED |
| 469 | fi |
| 470 | set "$@" OPENSSL="$OPENSSL" OPENSSL_LEGACY="$OPENSSL_LEGACY" |
| 471 | set "$@" GNUTLS_CLI="$GNUTLS_CLI" GNUTLS_SERV="$GNUTLS_SERV" |
| 472 | set "$@" GNUTLS_LEGACY_CLI="$GNUTLS_LEGACY_CLI" |
| 473 | set "$@" GNUTLS_LEGACY_SERV="$GNUTLS_LEGACY_SERV" |
| 474 | check_tools "$OPENSSL" "$OPENSSL_LEGACY" \ |
| 475 | "$GNUTLS_CLI" "$GNUTLS_SERV" \ |
| 476 | "$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV" |
| 477 | ;; |
| 478 | esac |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 479 | |
Gilles Peskine | 541fb1e | 2019-01-06 22:40:00 +0000 | [diff] [blame^] | 480 | case " $RUN_COMPONENTS " in |
| 481 | *_doxygen[_\ ]*) check_tools "doxygen" "dot";; |
| 482 | esac |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 483 | |
Gilles Peskine | 541fb1e | 2019-01-06 22:40:00 +0000 | [diff] [blame^] | 484 | case " $RUN_COMPONENTS " in |
| 485 | *_arm_none_eabi_gcc[_\ ]*) check_tools "arm-none-eabi-gcc";; |
| 486 | esac |
| 487 | |
| 488 | case " $RUN_COMPONENTS " in |
| 489 | *_mingw[_\ ]*) check_tools "i686-w64-mingw32-gcc";; |
| 490 | esac |
| 491 | |
| 492 | case " $RUN_COMPONENTS " in |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 493 | *_armcc*|*_yotta*) |
Gilles Peskine | 541fb1e | 2019-01-06 22:40:00 +0000 | [diff] [blame^] | 494 | ARMC5_CC="$ARMC5_BIN_DIR/armcc" |
| 495 | ARMC5_AR="$ARMC5_BIN_DIR/armar" |
| 496 | ARMC6_CC="$ARMC6_BIN_DIR/armclang" |
| 497 | ARMC6_AR="$ARMC6_BIN_DIR/armar" |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 498 | check_tools "$ARMC5_CC" "$ARMC5_AR" "$ARMC6_CC" "$ARMC6_AR";; |
| 499 | esac |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 500 | |
| 501 | msg "info: output_env.sh" |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 502 | case $RUN_COMPONENTS in |
| 503 | *_armcc*|*_yotta*) |
| 504 | set "$@" ARMC5_CC="$ARMC5_CC" ARMC6_CC="$ARMC6_CC" RUN_ARMCC=1;; |
| 505 | *) set "$@" RUN_ARMCC=0;; |
| 506 | esac |
| 507 | "$@" scripts/output_env.sh |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 508 | } |
Andres AG | d9eba4b | 2016-08-26 14:42:14 +0100 | [diff] [blame] | 509 | |
Gilles Peskine | 192c72f | 2017-12-21 15:59:21 +0100 | [diff] [blame] | 510 | |
| 511 | |
| 512 | ################################################################ |
| 513 | #### Basic checks |
| 514 | ################################################################ |
SimonB | 2e23c82 | 2016-04-16 21:54:39 +0100 | [diff] [blame] | 515 | |
| 516 | # |
| 517 | # Test Suites to be executed |
| 518 | # |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 519 | # The test ordering tries to optimize for the following criteria: |
Manuel Pégourié-Gonnard | 89d69b3 | 2014-11-20 13:48:53 +0100 | [diff] [blame] | 520 | # 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] | 521 | # and/or are more likely to fail than others (eg I use Clang most of the |
| 522 | # time, so start with a GCC build). |
Manuel Pégourié-Gonnard | 57255b1 | 2014-06-09 11:21:49 +0200 | [diff] [blame] | 523 | # 2. Minimize total running time, by avoiding useless rebuilds |
| 524 | # |
| 525 | # Indicative running times are given for reference. |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 526 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 527 | component_check_recursion () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 528 | msg "test: recursion.pl" # < 1s |
| 529 | record_status tests/scripts/recursion.pl library/*.c |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 530 | } |
Manuel Pégourié-Gonnard | ea29d15 | 2014-11-20 17:32:33 +0100 | [diff] [blame] | 531 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 532 | component_check_generated_files () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 533 | msg "test: freshness of generated source files" # < 1s |
| 534 | record_status tests/scripts/check-generated-files.sh |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 535 | } |
Manuel Pégourié-Gonnard | b3b8e43 | 2015-02-13 14:52:19 +0000 | [diff] [blame] | 536 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 537 | component_check_doxy_blocks () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 538 | msg "test: doxygen markup outside doxygen blocks" # < 1s |
| 539 | record_status tests/scripts/check-doxy-blocks.pl |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 540 | } |
Manuel Pégourié-Gonnard | d09a6b5 | 2015-04-09 17:19:23 +0200 | [diff] [blame] | 541 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 542 | component_check_files () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 543 | msg "test: check-files.py" # < 1s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 544 | record_status tests/scripts/check-files.py |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 545 | } |
Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 546 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 547 | component_check_names () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 548 | msg "test/build: declared and exported names" # < 3s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 549 | record_status tests/scripts/check-names.sh |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 550 | } |
Manuel Pégourié-Gonnard | 9b06abe | 2015-06-25 09:56:07 +0200 | [diff] [blame] | 551 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 552 | component_check_doxygen_warnings () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 553 | msg "test: doxygen warnings" # ~ 3s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 554 | record_status tests/scripts/doxygen.sh |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 555 | } |
Andres Amaya Garcia | dd29c2f | 2017-05-04 11:35:51 +0100 | [diff] [blame] | 556 | |
Simon Butcher | 948f264 | 2018-07-20 21:27:33 +0100 | [diff] [blame] | 557 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 558 | ################################################################ |
| 559 | #### Build and test many configurations and targets |
| 560 | ################################################################ |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 561 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 562 | component_build_yotta () { |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 563 | # Note - use of yotta is deprecated, and yotta also requires armcc to be on the |
| 564 | # path, and uses whatever version of armcc it finds there. |
| 565 | msg "build: create and build yotta module" # ~ 30s |
| 566 | record_status tests/scripts/yotta-build.sh |
| 567 | } |
| 568 | support_build_yotta () { |
| 569 | [ $YOTTA -ne 0 ] |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 570 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 571 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 572 | component_test_default_cmake_gcc_asan () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 573 | msg "build: cmake, gcc, ASan" # ~ 1 min 50s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 574 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 575 | make |
Manuel Pégourié-Gonnard | 4a9dc2a | 2014-05-09 13:46:59 +0200 | [diff] [blame] | 576 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 577 | msg "test: main suites (inc. selftests) (ASan build)" # ~ 50s |
Gilles Peskine | 7ad603e | 2017-12-10 23:22:20 +0100 | [diff] [blame] | 578 | make test |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 579 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 580 | msg "test: ssl-opt.sh (ASan build)" # ~ 1 min |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 581 | if_build_succeeded tests/ssl-opt.sh |
Manuel Pégourié-Gonnard | 9bda9b3 | 2014-11-20 13:10:22 +0100 | [diff] [blame] | 582 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 583 | msg "test: compat.sh (ASan build)" # ~ 6 min |
| 584 | if_build_succeeded tests/compat.sh |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 585 | } |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 586 | |
Gilles Peskine | 3484ed8 | 2019-01-08 22:51:19 +0100 | [diff] [blame] | 587 | component_test_ref_configs () { |
| 588 | msg "test/build: ref-configs (ASan build)" # ~ 6 min 20s |
| 589 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 590 | record_status tests/scripts/test-ref-configs.pl |
| 591 | } |
| 592 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 593 | component_test_sslv3 () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 594 | msg "build: Default + SSLv3 (ASan build)" # ~ 6 min |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 595 | scripts/config.pl set MBEDTLS_SSL_PROTO_SSL3 |
| 596 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 597 | make |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 598 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 599 | msg "test: SSLv3 - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 600 | make test |
| 601 | |
| 602 | msg "build: SSLv3 - compat.sh (ASan build)" # ~ 6 min |
| 603 | if_build_succeeded tests/compat.sh -m 'tls1 tls1_1 tls1_2 dtls1 dtls1_2' |
| 604 | if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" tests/compat.sh -m 'ssl3' |
| 605 | |
| 606 | msg "build: SSLv3 - ssl-opt.sh (ASan build)" # ~ 6 min |
| 607 | if_build_succeeded tests/ssl-opt.sh |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 608 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 609 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 610 | component_test_no_renegotiation () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 611 | msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 612 | scripts/config.pl unset MBEDTLS_SSL_RENEGOTIATION |
| 613 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 614 | make |
| 615 | |
| 616 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 617 | make test |
| 618 | |
| 619 | msg "test: !MBEDTLS_SSL_RENEGOTIATION - ssl-opt.sh (ASan build)" # ~ 6 min |
| 620 | if_build_succeeded tests/ssl-opt.sh |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 621 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 622 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 623 | component_test_rsa_no_crt () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 624 | msg "build: Default + RSA_NO_CRT (ASan build)" # ~ 6 min |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 625 | scripts/config.pl set MBEDTLS_RSA_NO_CRT |
| 626 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 627 | make |
| 628 | |
| 629 | msg "test: RSA_NO_CRT - main suites (inc. selftests) (ASan build)" # ~ 50s |
| 630 | make test |
| 631 | |
| 632 | msg "test: RSA_NO_CRT - RSA-related part of ssl-opt.sh (ASan build)" # ~ 5s |
| 633 | if_build_succeeded tests/ssl-opt.sh -f RSA |
| 634 | |
| 635 | msg "test: RSA_NO_CRT - RSA-related part of compat.sh (ASan build)" # ~ 3 min |
| 636 | if_build_succeeded tests/compat.sh -t RSA |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 637 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 638 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 639 | component_test_full_cmake_clang () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 640 | msg "build: cmake, full config, clang" # ~ 50s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 641 | scripts/config.pl full |
| 642 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests |
| 643 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check -D ENABLE_TESTING=On . |
| 644 | make |
| 645 | |
| 646 | msg "test: main suites (full config)" # ~ 5s |
| 647 | make test |
| 648 | |
| 649 | msg "test: ssl-opt.sh default (full config)" # ~ 1s |
| 650 | if_build_succeeded tests/ssl-opt.sh -f Default |
| 651 | |
| 652 | msg "test: compat.sh RC4, DES & NULL (full config)" # ~ 2 min |
| 653 | if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" GNUTLS_CLI="$GNUTLS_LEGACY_CLI" GNUTLS_SERV="$GNUTLS_LEGACY_SERV" tests/compat.sh -e '3DES\|DES-CBC3' -f 'NULL\|DES\|RC4\|ARCFOUR' |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 654 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 655 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 656 | component_build_deprecated () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 657 | msg "build: make, full config + DEPRECATED_WARNING, gcc -O" # ~ 30s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 658 | scripts/config.pl full |
| 659 | scripts/config.pl set MBEDTLS_DEPRECATED_WARNING |
| 660 | # Build with -O -Wextra to catch a maximum of issues. |
| 661 | make CC=gcc CFLAGS='-O -Werror -Wall -Wextra' lib programs |
| 662 | make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests |
| 663 | |
| 664 | msg "build: make, full config + DEPRECATED_REMOVED, clang -O" # ~ 30s |
| 665 | # No cleanup, just tweak the configuration and rebuild |
| 666 | make clean |
| 667 | scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING |
| 668 | scripts/config.pl set MBEDTLS_DEPRECATED_REMOVED |
| 669 | # Build with -O -Wextra to catch a maximum of issues. |
| 670 | make CC=clang CFLAGS='-O -Werror -Wall -Wextra' lib programs |
| 671 | make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 672 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 673 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 674 | component_test_depends_curves () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 675 | msg "test/build: curves.pl (gcc)" # ~ 4 min |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 676 | record_status tests/scripts/curves.pl |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 677 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 678 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 679 | component_test_depends_hashes () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 680 | msg "test/build: depends-hashes.pl (gcc)" # ~ 2 min |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 681 | record_status tests/scripts/depends-hashes.pl |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 682 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 683 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 684 | component_test_depends_pkalgs () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 685 | msg "test/build: depends-pkalgs.pl (gcc)" # ~ 2 min |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 686 | record_status tests/scripts/depends-pkalgs.pl |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 687 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 688 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 689 | component_build_key_exchanges () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 690 | msg "test/build: key-exchanges (gcc)" # ~ 1 min |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 691 | record_status tests/scripts/key-exchanges.pl |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 692 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 693 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 694 | component_build_default_make_gcc () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 695 | msg "build: Unix make, -Os (gcc)" # ~ 30s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 696 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -Os' |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 697 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 698 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 699 | component_test_no_platform () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 700 | # Full configuration build, without platform support, file IO and net sockets. |
| 701 | # This should catch missing mbedtls_printf definitions, and by disabling file |
| 702 | # IO, it should catch missing '#include <stdio.h>' |
| 703 | msg "build: full config except platform/fsio/net, make, gcc, C99" # ~ 30s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 704 | scripts/config.pl full |
| 705 | scripts/config.pl unset MBEDTLS_PLATFORM_C |
| 706 | scripts/config.pl unset MBEDTLS_NET_C |
| 707 | scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY |
| 708 | scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT |
| 709 | scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT |
| 710 | scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT |
| 711 | scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT |
| 712 | scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT |
| 713 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
| 714 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 715 | scripts/config.pl unset MBEDTLS_FS_IO |
| 716 | # Note, _DEFAULT_SOURCE needs to be defined for platforms using glibc version >2.19, |
| 717 | # to re-enable platform integration features otherwise disabled in C99 builds |
| 718 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -std=c99 -pedantic -O0 -D_DEFAULT_SOURCE' lib programs |
| 719 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' test |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 720 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 721 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 722 | component_build_no_std_function () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 723 | # catch compile bugs in _uninit functions |
| 724 | msg "build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 725 | scripts/config.pl full |
| 726 | scripts/config.pl set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS |
| 727 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
| 728 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 729 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 730 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 731 | component_build_no_ssl_srv () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 732 | msg "build: full config except ssl_srv.c, make, gcc" # ~ 30s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 733 | scripts/config.pl full |
| 734 | scripts/config.pl unset MBEDTLS_SSL_SRV_C |
| 735 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 736 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 737 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 738 | component_build_no_ssl_cli () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 739 | msg "build: full config except ssl_cli.c, make, gcc" # ~ 30s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 740 | scripts/config.pl full |
| 741 | scripts/config.pl unset MBEDTLS_SSL_CLI_C |
| 742 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 743 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 744 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 745 | component_build_no_sockets () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 746 | # Note, C99 compliance can also be tested with the sockets support disabled, |
| 747 | # as that requires a POSIX platform (which isn't the same as C99). |
| 748 | msg "build: full config except net_sockets.c, make, gcc -std=c99 -pedantic" # ~ 30s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 749 | scripts/config.pl full |
| 750 | scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc. |
| 751 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux |
| 752 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0 -std=c99 -pedantic' lib |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 753 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 754 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 755 | component_test_no_max_fragment_length () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 756 | msg "build: default config except MFL extension (ASan build)" # ~ 30s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 757 | scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 758 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 759 | make |
| 760 | |
| 761 | msg "test: ssl-opt.sh, MFL-related tests" |
| 762 | if_build_succeeded tests/ssl-opt.sh -f "Max fragment length" |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 763 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 764 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 765 | component_test_null_entropy () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 766 | msg "build: default config with MBEDTLS_TEST_NULL_ENTROPY (ASan build)" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 767 | scripts/config.pl set MBEDTLS_TEST_NULL_ENTROPY |
| 768 | scripts/config.pl set MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES |
| 769 | scripts/config.pl set MBEDTLS_ENTROPY_C |
| 770 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
| 771 | scripts/config.pl unset MBEDTLS_ENTROPY_HARDWARE_ALT |
| 772 | scripts/config.pl unset MBEDTLS_HAVEGE_C |
Gilles Peskine | 4e7b323 | 2019-01-06 19:48:30 +0000 | [diff] [blame] | 773 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan -D UNSAFE_BUILD=ON . |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 774 | make |
| 775 | |
| 776 | msg "test: MBEDTLS_TEST_NULL_ENTROPY - main suites (inc. selftests) (ASan build)" |
| 777 | make test |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 778 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 779 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 780 | component_test_platform_calloc_macro () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 781 | msg "build: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 782 | scripts/config.pl set MBEDTLS_PLATFORM_MEMORY |
| 783 | scripts/config.pl set MBEDTLS_PLATFORM_CALLOC_MACRO calloc |
| 784 | scripts/config.pl set MBEDTLS_PLATFORM_FREE_MACRO free |
| 785 | CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . |
| 786 | make |
| 787 | |
| 788 | msg "test: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)" |
| 789 | make test |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 790 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 791 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 792 | component_test_make_shared () { |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 793 | msg "build/test: make shared" # ~ 40s |
| 794 | make SHARED=1 all check |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 795 | } |
| 796 | |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 797 | component_test_m32_o0 () { |
| 798 | # Build once with -O0, to compile out the i386 specific inline assembly |
| 799 | msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s |
| 800 | scripts/config.pl full |
| 801 | make CC=gcc CFLAGS='-O0 -Werror -Wall -Wextra -m32 -fsanitize=address' |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 802 | |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 803 | msg "test: i386, make, gcc -O0 (ASan build)" |
| 804 | make test |
| 805 | } |
| 806 | support_test_m32_o0 () { |
| 807 | case $(uname -m) in |
| 808 | *64*) true;; |
| 809 | *) false;; |
| 810 | esac |
| 811 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 812 | |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 813 | component_test_m32_o1 () { |
| 814 | # Build again with -O1, to compile in the i386 specific inline assembly |
| 815 | msg "build: i386, make, gcc -O1 (ASan build)" # ~ 30s |
| 816 | scripts/config.pl full |
| 817 | make CC=gcc CFLAGS='-O1 -Werror -Wall -Wextra -m32 -fsanitize=address' |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 818 | |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 819 | msg "test: i386, make, gcc -O1 (ASan build)" |
| 820 | make test |
| 821 | } |
| 822 | support_test_m32_o1 () { |
| 823 | support_test_m32_o0 "$@" |
| 824 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 825 | |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 826 | component_test_mx32 () { |
| 827 | msg "build: 64-bit ILP32, make, gcc" # ~ 30s |
| 828 | scripts/config.pl full |
| 829 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -mx32' |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 830 | |
Gilles Peskine | 3fbdd21 | 2019-01-08 23:33:45 +0100 | [diff] [blame] | 831 | msg "test: 64-bit ILP32, make, gcc" |
| 832 | make test |
| 833 | } |
| 834 | support_test_mx32 () { |
| 835 | case $(uname -m) in |
| 836 | amd64|x86_64) true;; |
| 837 | *) false;; |
| 838 | esac |
| 839 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 840 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 841 | component_test_have_int32 () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 842 | msg "build: gcc, force 32-bit bignum limbs" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 843 | scripts/config.pl unset MBEDTLS_HAVE_ASM |
| 844 | scripts/config.pl unset MBEDTLS_AESNI_C |
| 845 | scripts/config.pl unset MBEDTLS_PADLOCK_C |
| 846 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT32' |
| 847 | |
| 848 | msg "test: gcc, force 32-bit bignum limbs" |
| 849 | make test |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 850 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 851 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 852 | component_test_have_int64 () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 853 | msg "build: gcc, force 64-bit bignum limbs" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 854 | scripts/config.pl unset MBEDTLS_HAVE_ASM |
| 855 | scripts/config.pl unset MBEDTLS_AESNI_C |
| 856 | scripts/config.pl unset MBEDTLS_PADLOCK_C |
| 857 | make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT64' |
| 858 | |
| 859 | msg "test: gcc, force 64-bit bignum limbs" |
| 860 | make test |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 861 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 862 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 863 | component_build_arm_none_eabi_gcc () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 864 | msg "build: arm-none-eabi-gcc, make" # ~ 10s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 865 | scripts/config.pl full |
| 866 | scripts/config.pl unset MBEDTLS_NET_C |
| 867 | scripts/config.pl unset MBEDTLS_TIMING_C |
| 868 | scripts/config.pl unset MBEDTLS_FS_IO |
| 869 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
| 870 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY |
| 871 | # following things are not in the default config |
| 872 | scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c |
| 873 | scripts/config.pl unset MBEDTLS_THREADING_PTHREAD |
| 874 | scripts/config.pl unset MBEDTLS_THREADING_C |
| 875 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h |
| 876 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit |
| 877 | make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 878 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 879 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 880 | component_build_arm_none_eabi_gcc_no_udbl_division () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 881 | msg "build: arm-none-eabi-gcc -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 882 | scripts/config.pl full |
| 883 | scripts/config.pl unset MBEDTLS_NET_C |
| 884 | scripts/config.pl unset MBEDTLS_TIMING_C |
| 885 | scripts/config.pl unset MBEDTLS_FS_IO |
| 886 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
| 887 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY |
| 888 | # following things are not in the default config |
| 889 | scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c |
| 890 | scripts/config.pl unset MBEDTLS_THREADING_PTHREAD |
| 891 | scripts/config.pl unset MBEDTLS_THREADING_C |
| 892 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h |
| 893 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit |
| 894 | scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION |
| 895 | make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib |
| 896 | echo "Checking that software 64-bit division is not required" |
| 897 | ! grep __aeabi_uldiv library/*.o |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 898 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 899 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 900 | component_build_armcc () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 901 | msg "build: ARM Compiler 5, make" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 902 | scripts/config.pl full |
| 903 | scripts/config.pl unset MBEDTLS_NET_C |
| 904 | scripts/config.pl unset MBEDTLS_TIMING_C |
| 905 | scripts/config.pl unset MBEDTLS_FS_IO |
| 906 | scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED |
| 907 | scripts/config.pl unset MBEDTLS_HAVE_TIME |
| 908 | scripts/config.pl unset MBEDTLS_HAVE_TIME_DATE |
| 909 | scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY |
| 910 | # following things are not in the default config |
| 911 | scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING |
| 912 | scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c |
| 913 | scripts/config.pl unset MBEDTLS_THREADING_PTHREAD |
| 914 | scripts/config.pl unset MBEDTLS_THREADING_C |
| 915 | scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h |
| 916 | scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit |
| 917 | scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT # depends on MBEDTLS_HAVE_TIME |
| 918 | |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 919 | make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib |
| 920 | make clean |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 921 | |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 922 | # ARM Compiler 6 - Target ARMv7-A |
| 923 | armc6_build_test "--target=arm-arm-none-eabi -march=armv7-a" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 924 | |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 925 | # ARM Compiler 6 - Target ARMv7-M |
| 926 | armc6_build_test "--target=arm-arm-none-eabi -march=armv7-m" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 927 | |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 928 | # ARM Compiler 6 - Target ARMv8-A - AArch32 |
| 929 | armc6_build_test "--target=arm-arm-none-eabi -march=armv8.2-a" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 930 | |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 931 | # ARM Compiler 6 - Target ARMv8-M |
| 932 | armc6_build_test "--target=arm-arm-none-eabi -march=armv8-m.main" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 933 | |
Gilles Peskine | 5308487 | 2019-01-09 23:13:54 +0100 | [diff] [blame] | 934 | # ARM Compiler 6 - Target ARMv8-A - AArch64 |
| 935 | armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a" |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 936 | } |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 937 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 938 | component_test_allow_sha1 () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 939 | msg "build: allow SHA1 in certificates by default" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 940 | scripts/config.pl set MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 941 | make CFLAGS='-Werror -Wall -Wextra' |
| 942 | msg "test: allow SHA1 in certificates by default" |
| 943 | make test |
| 944 | if_build_succeeded tests/ssl-opt.sh -f SHA-1 |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 945 | } |
Manuel Pégourié-Gonnard | 392d3dd | 2015-01-26 14:03:56 +0000 | [diff] [blame] | 946 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 947 | component_build_mingw () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 948 | msg "build: Windows cross build - mingw64, make (Link Library)" # ~ 30s |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 949 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 lib programs |
| 950 | |
| 951 | # note Make tests only builds the tests, but doesn't run them |
| 952 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror' WINDOWS_BUILD=1 tests |
| 953 | make WINDOWS_BUILD=1 clean |
| 954 | |
| 955 | msg "build: Windows cross build - mingw64, make (DLL)" # ~ 30s |
| 956 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 lib programs |
| 957 | make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 tests |
| 958 | make WINDOWS_BUILD=1 clean |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 959 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 960 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 961 | component_test_memsan () { |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 962 | msg "build: MSan (clang)" # ~ 1 min 20s |
| 963 | scripts/config.pl unset MBEDTLS_AESNI_C # memsan doesn't grok asm |
| 964 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan . |
| 965 | make |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 966 | |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 967 | msg "test: main suites (MSan)" # ~ 10s |
| 968 | make test |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 969 | |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 970 | msg "test: ssl-opt.sh (MSan)" # ~ 1 min |
| 971 | if_build_succeeded tests/ssl-opt.sh |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 972 | |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 973 | # Optional part(s) |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 974 | |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 975 | if [ "$MEMORY" -gt 0 ]; then |
| 976 | msg "test: compat.sh (MSan)" # ~ 6 min 20s |
| 977 | if_build_succeeded tests/compat.sh |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 978 | fi |
| 979 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 980 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 981 | component_test_memcheck () { |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 982 | msg "build: Release (clang)" |
| 983 | CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release . |
| 984 | make |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 985 | |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 986 | msg "test: main suites valgrind (Release)" |
| 987 | make memcheck |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 988 | |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 989 | # Optional part(s) |
| 990 | # Currently broken, programs don't seem to receive signals |
| 991 | # under valgrind on OS X |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 992 | |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 993 | if [ "$MEMORY" -gt 0 ]; then |
| 994 | msg "test: ssl-opt.sh --memcheck (Release)" |
| 995 | if_build_succeeded tests/ssl-opt.sh --memcheck |
| 996 | fi |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 997 | |
Gilles Peskine | 770ad7e | 2019-01-08 23:19:08 +0100 | [diff] [blame] | 998 | if [ "$MEMORY" -gt 1 ]; then |
| 999 | msg "test: compat.sh --memcheck (Release)" |
| 1000 | if_build_succeeded tests/compat.sh --memcheck |
| 1001 | fi |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 1002 | } |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 1003 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 1004 | component_test_cmake_out_of_source () { |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 1005 | msg "build: cmake 'out-of-source' build" |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 1006 | MBEDTLS_ROOT_DIR="$PWD" |
| 1007 | mkdir "$OUT_OF_SOURCE_DIR" |
| 1008 | cd "$OUT_OF_SOURCE_DIR" |
| 1009 | cmake "$MBEDTLS_ROOT_DIR" |
| 1010 | make |
| 1011 | |
| 1012 | msg "test: cmake 'out-of-source' build" |
| 1013 | make test |
| 1014 | # Test an SSL option that requires an auxiliary script in test/scripts/. |
| 1015 | # Also ensure that there are no error messages such as |
| 1016 | # "No such file or directory", which would indicate that some required |
| 1017 | # file is missing (ssl-opt.sh tolerates the absence of some files so |
| 1018 | # may exit with status 0 but emit errors). |
| 1019 | if_build_succeeded ./tests/ssl-opt.sh -f 'Fallback SCSV: beginning of list' 2>ssl-opt.err |
| 1020 | if [ -s ssl-opt.err ]; then |
| 1021 | cat ssl-opt.err >&2 |
| 1022 | record_status [ ! -s ssl-opt.err ] |
| 1023 | rm ssl-opt.err |
| 1024 | fi |
| 1025 | cd "$MBEDTLS_ROOT_DIR" |
| 1026 | rm -rf "$OUT_OF_SOURCE_DIR" |
| 1027 | unset MBEDTLS_ROOT_DIR |
| 1028 | } |
Andres AG | dc19221 | 2016-08-31 17:33:13 +0100 | [diff] [blame] | 1029 | |
Gilles Peskine | 192c72f | 2017-12-21 15:59:21 +0100 | [diff] [blame] | 1030 | |
| 1031 | |
| 1032 | ################################################################ |
| 1033 | #### Termination |
| 1034 | ################################################################ |
| 1035 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 1036 | post_report () { |
| 1037 | msg "Done, cleaning up" |
| 1038 | cleanup |
| 1039 | |
| 1040 | final_report |
| 1041 | } |
| 1042 | |
| 1043 | |
| 1044 | |
| 1045 | ################################################################ |
| 1046 | #### Run all the things |
| 1047 | ################################################################ |
| 1048 | |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 1049 | # Run one component and clean up afterwards. |
| 1050 | run_component () { |
Gilles Peskine | 72adb43 | 2019-01-02 18:57:02 +0100 | [diff] [blame] | 1051 | # Back up the configuration in case the component modifies it. |
| 1052 | # The cleanup function will restore it. |
| 1053 | cp -p "$CONFIG_H" "$CONFIG_BAK" |
Gilles Peskine | 11ddca6 | 2018-12-04 12:49:28 +0100 | [diff] [blame] | 1054 | current_component="$1" |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 1055 | "$@" |
| 1056 | cleanup |
| 1057 | } |
| 1058 | |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 1059 | # Preliminary setup |
| 1060 | pre_check_environment |
| 1061 | pre_initialize_variables |
| 1062 | pre_parse_command_line "$@" |
| 1063 | |
| 1064 | pre_check_git |
| 1065 | build_status=0 |
| 1066 | if [ $KEEP_GOING -eq 1 ]; then |
| 1067 | pre_setup_keep_going |
| 1068 | else |
| 1069 | record_status () { |
| 1070 | "$@" |
| 1071 | } |
| 1072 | fi |
| 1073 | pre_print_configuration |
| 1074 | pre_check_tools |
Manuel Pégourié-Gonnard | 80955ee | 2014-03-19 18:29:01 +0100 | [diff] [blame] | 1075 | cleanup |
Gilles Peskine | 7c65216 | 2017-12-11 00:01:40 +0100 | [diff] [blame] | 1076 | |
Gilles Peskine | eb39b9b | 2019-01-08 23:41:00 +0100 | [diff] [blame] | 1077 | # Run the requested tests. |
Gilles Peskine | 6e98423 | 2018-11-27 21:37:53 +0100 | [diff] [blame] | 1078 | for component in $RUN_COMPONENTS; do |
Gilles Peskine | 1a2ca72 | 2019-01-08 22:35:16 +0100 | [diff] [blame] | 1079 | run_component "component_$component" |
| 1080 | done |
Gilles Peskine | 57db6ff | 2019-01-08 22:04:31 +0100 | [diff] [blame] | 1081 | |
| 1082 | # We're done. |
| 1083 | post_report |