Avoid checking the same extensions more than once

pull/61/head
Michele Locati 2019-12-17 09:48:49 +01:00
parent 09a1241248
commit caafc261d5
No known key found for this signature in database
GPG Key ID: 98B7CE2E7234E28B
1 changed files with 12 additions and 7 deletions

View File

@ -17,6 +17,7 @@ fi
. "${TRAVIS_BUILD_DIR}/scripts/common" . "${TRAVIS_BUILD_DIR}/scripts/common"
ALREADY_TESTED_EXTENSIONS=''
# Get the docker image ID for a PHP extension and a PHP version # Get the docker image ID for a PHP extension and a PHP version
# #
@ -95,12 +96,13 @@ testNewExtensionLine () {
if test $# -lt 2; then if test $# -lt 2; then
printf 'Missing PHP version list for the new extension %s\n' "${1:-}" printf 'Missing PHP version list for the new extension %s\n' "${1:-}"
testNewExtensionLine_rc=1 testNewExtensionLine_rc=1
else elif ! stringInList "$1" "$ALREADY_TESTED_EXTENSIONS"; then
printf '### TESTING NEW EXTENSION %s ###\n' "${1}" printf '### TESTING NEW EXTENSION %s ###\n' "${1}"
if test -n "$(printf '%s' "${1}" | sed -E 's/^[a-z][a-z0-9\-\_\.]+$//')"; then if test -n "$(printf '%s' "${1}" | sed -E 's/^[a-z][a-z0-9\-\_\.]+$//')"; then
printf ' INVALID PHP EXTENSION NAME: %s\n' "${1}" >&2 printf ' INVALID PHP EXTENSION NAME: %s\n' "${1}" >&2
testNewExtensionLine_rc=1 testNewExtensionLine_rc=1
else else
ALREADY_TESTED_EXTENSIONS="$ALREADY_TESTED_EXTENSIONS $1"
testNewExtensionLine_extension="${1}" testNewExtensionLine_extension="${1}"
while test $# -ge 2; do while test $# -ge 2; do
shift shift
@ -203,12 +205,15 @@ testExtensionsFromMessage () {
fi fi
IFS=' ' IFS=' '
for TEST_EXTENSION in $TEST_EXTENSIONS; do for TEST_EXTENSION in $TEST_EXTENSIONS; do
printf '### TESTING EXTENSION %s ###\n' "$TEST_EXTENSION" if ! stringInList "$TEST_EXTENSION" "$ALREADY_TESTED_EXTENSIONS"; then
for TEST_PHPVERSION in $(getAllPHPVersionsFor $TEST_EXTENSION); do ALREADY_TESTED_EXTENSIONS="$ALREADY_TESTED_EXTENSIONS $TEST_EXTENSION"
if ! testExtension "$TEST_EXTENSION" "$TEST_PHPVERSION"; then printf '### TESTING EXTENSION %s ###\n' "$TEST_EXTENSION"
testExtensionsFromMessage_result=1 for TEST_PHPVERSION in $(getAllPHPVersionsFor $TEST_EXTENSION); do
fi if ! testExtension "$TEST_EXTENSION" "$TEST_PHPVERSION"; then
done testExtensionsFromMessage_result=1
fi
done
fi
done done
done done
resetIFS resetIFS