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