aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Peskine <Gilles.Peskine@arm.com>2019-09-20 19:56:06 +0200
committerSimon Butcher <simon.butcher@arm.com>2020-03-13 17:06:18 +0000
commita4c1c4b55d1884fef8dad38a3510020949a5d630 (patch)
tree33853bc0557ddcbc4fb4628d5d0c8a313a63a471
parent06c1e239609c89c4769d42f3b4b991bf8c824475 (diff)
downloadmbed-tls-a4c1c4b55d1884fef8dad38a3510020949a5d630.tar.gz
Test GCC and Clang with common build options
Goals: * Build with common compilers with common options, so that we don't miss a (potentially useful) warning only triggered with certain build options. * A previous commit removed -O0 test jobs, leaving only the one with -m32. We have inline assembly that is disabled with -O0, falling back to generic C code. This commit restores a test that runs the generic C code on a 64-bit platform.
-rwxr-xr-xtests/scripts/all.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh
index 9cb3ec1da..ae2e11283 100755
--- a/tests/scripts/all.sh
+++ b/tests/scripts/all.sh
@@ -1375,6 +1375,30 @@ component_test_cmake_shared () {
make test
}
+test_build_opt () {
+ info=$1 cc=$2; shift 2
+ for opt in "$@"; do
+ msg "build/test: $cc $opt, $info" # ~ 30s
+ make CC="$cc" CFLAGS="$opt -Wall -Wextra -Werror"
+ # We're confident enough in compilers to not run _all_ the tests,
+ # but at least run the unit tests. In particular, runs with
+ # optimizations use inline assembly whereas runs with -O0
+ # skip inline assembly.
+ make test # ~30s
+ make clean
+ done
+}
+
+component_test_clang_opt () {
+ scripts/config.pl full
+ test_build_opt 'full config' clang -O0 -Os -O2
+}
+
+component_test_gcc_opt () {
+ scripts/config.pl full
+ test_build_opt 'full config' gcc -O0 -Os -O2
+}
+
component_build_mbedtls_config_file () {
msg "build: make with MBEDTLS_CONFIG_FILE" # ~40s
# Use the full config so as to catch a maximum of places where