Skip to content

Commit

Permalink
all.sh: reorganize testing around deprecated features
Browse files Browse the repository at this point in the history
build_deprecated combined the testing of deprecated features, and
testing of the build without deprecated features. Also, it violated the
component naming convention by being called build_xxx but running tests.

Replace it by:
* test_default_no_deprecated: check that you can remove deprecated
  features from the default build.
* test_full_deprecated_warning: check that enabling DEPRECATED_WARNING
  doesn't cause any warning from our own code.

Signed-off-by: Gilles Peskine <[email protected]>
  • Loading branch information
gilles-peskine-arm committed Apr 30, 2020
1 parent 457351a commit adaaddb
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions tests/scripts/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -770,22 +770,31 @@ component_test_full_cmake_clang () {
if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" GNUTLS_CLI="$GNUTLS_LEGACY_CLI" GNUTLS_SERV="$GNUTLS_LEGACY_SERV" tests/compat.sh -e '^$' -f 'NULL\|DES\|RC4\|ARCFOUR'
}

component_build_deprecated () {
msg "build: make, full config + DEPRECATED_WARNING, gcc -O" # ~ 30s
component_test_default_no_deprecated () {
# Test that removing the deprecated features from the default
# configuration leaves something consistent.
msg "build: make, default + MBEDTLS_DEPRECATED_REMOVED" # ~ 30s
scripts/config.pl set MBEDTLS_DEPRECATED_REMOVED
make CC=gcc CFLAGS='-O -Werror -Wall -Wextra'

msg "test: make, default + MBEDTLS_DEPRECATED_REMOVED" # ~ 5s
make test
}

component_test_full_deprecated_warning () {
# Test that there is nothing deprecated in the full configuraration.
# A deprecated feature would trigger a warning (made fatal) from
# MBEDTLS_DEPRECATED_WARNING.
msg "build: make, full + MBEDTLS_DEPRECATED_WARNING" # ~ 30s
scripts/config.pl full
scripts/config.pl unset MBEDTLS_DEPRECATED_REMOVED
scripts/config.pl set MBEDTLS_DEPRECATED_WARNING
# Build with -O -Wextra to catch a maximum of issues.
make CC=gcc CFLAGS='-O -Werror -Wall -Wextra' lib programs
make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
# There are currently no tests for any deprecated feature.
# If some are added, 'make test' would trigger warnings here.
make CC=gcc CFLAGS='-O -Werror -Wall -Wextra'

msg "build: make, full config + DEPRECATED_REMOVED, clang -O" # ~ 30s
# No cleanup, just tweak the configuration and rebuild
make clean
scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING
scripts/config.pl set MBEDTLS_DEPRECATED_REMOVED
# Build with -O -Wextra to catch a maximum of issues.
make CC=clang CFLAGS='-O -Werror -Wall -Wextra' lib programs
make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
msg "test: make, full + MBEDTLS_DEPRECATED_WARNING" # ~ 5s
make test
}

component_test_depends_curves () {
Expand Down

0 comments on commit adaaddb

Please sign in to comment.