From cc9f0b956e123cdf869f433309c327320afeb8ba Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Sun, 6 Jan 2019 22:46:21 +0000 Subject: [PATCH] Merge the code to call output_env.sh into pre_check_tools It's all about tool detection. --- tests/scripts/all.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 89b3cc87f..1347a46b0 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -463,6 +463,9 @@ pre_print_configuration () { # Make sure the tools we need are available. pre_check_tools () { + # Build the list of variables to pass to output_env.sh. + set env + case " $RUN_COMPONENTS " in # Require OpenSSL and GnuTLS if running any tests (as opposed to # only doing builds). Not all tests run OpenSSL and GnuTLS, but this @@ -477,6 +480,10 @@ pre_check_tools () { if [ -n "${SEED-}" ]; then export SEED fi + set "$@" OPENSSL="$OPENSSL" OPENSSL_LEGACY="$OPENSSL_LEGACY" + set "$@" GNUTLS_CLI="$GNUTLS_CLI" GNUTLS_SERV="$GNUTLS_SERV" + set "$@" GNUTLS_LEGACY_CLI="$GNUTLS_LEGACY_CLI" + set "$@" GNUTLS_LEGACY_SERV="$GNUTLS_LEGACY_SERV" check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$OPENSSL_NEXT" \ "$GNUTLS_CLI" "$GNUTLS_SERV" \ "$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV" @@ -507,9 +514,18 @@ pre_check_tools () { ARMC6_AR="$ARMC6_BIN_DIR/armar" check_tools "$ARMC5_CC" "$ARMC5_AR" "$ARMC6_CC" "$ARMC6_AR";; esac + + msg "info: output_env.sh" + case $RUN_COMPONENTS in + *_armcc*) + set "$@" ARMC5_CC="$ARMC5_CC" ARMC6_CC="$ARMC6_CC" RUN_ARMCC=1;; + *) set "$@" RUN_ARMCC=0;; + esac + "$@" scripts/output_env.sh } + ################################################################ #### Basic checks ################################################################ @@ -525,20 +541,6 @@ pre_check_tools () { # # Indicative running times are given for reference. -pre_print_tools () { - msg "info: output_env.sh" - set env - set "$@" OPENSSL="$OPENSSL" OPENSSL_LEGACY="$OPENSSL_LEGACY" - set "$@" GNUTLS_CLI="$GNUTLS_CLI" GNUTLS_SERV="$GNUTLS_SERV" - set "$@" GNUTLS_LEGACY_CLI="$GNUTLS_LEGACY_CLI" GNUTLS_LEGACY_SERV="$GNUTLS_LEGACY_SERV" - case $RUN_COMPONENTS in - *_armcc*) - set "$@" ARMC5_CC="$ARMC5_CC" ARMC6_CC="$ARMC6_CC" RUN_ARMCC=1;; - *) set "$@" RUN_ARMCC=0;; - esac - "$@" scripts/output_env.sh -} - component_check_recursion () { msg "test: recursion.pl" # < 1s record_status tests/scripts/recursion.pl library/*.c @@ -1275,7 +1277,6 @@ else fi pre_print_configuration pre_check_tools -pre_print_tools cleanup # Run the requested tests.