Capture output of test build steps
parent
2635b0bec6
commit
6fbd39d2fa
|
@ -51,11 +51,20 @@ testExtension () {
|
||||||
printf 'PHP version: %s\n' "${2}"
|
printf 'PHP version: %s\n' "${2}"
|
||||||
if test -n "$(printf '%s' "${2}" | sed -E 's/^[0-9]+\.[0-9]+$//')"; then
|
if test -n "$(printf '%s' "${2}" | sed -E 's/^[0-9]+\.[0-9]+$//')"; then
|
||||||
printf ' INVALID PHP VERSION: %s\n' "${2}" >&2
|
printf ' INVALID PHP VERSION: %s\n' "${2}" >&2
|
||||||
return 0
|
return 1
|
||||||
fi
|
fi
|
||||||
testExtension_Image="$(getExtensionImage "${1}" "${2}")"
|
testExtension_Image="$(getExtensionImage "${1}" "${2}")"
|
||||||
printf ' - Docker image: %s\n' "${testExtension_Image}"
|
printf ' - Docker image: %s\n' "${testExtension_Image}"
|
||||||
docker run --rm --volume "${TRAVIS_BUILD_DIR}:/app" --workdir /app "${testExtension_Image}" bash -c "./install-php-extensions ${1} && php -r "'"'"exit(extension_loaded('${1}') ? 0 : 1);"'"'""
|
testExtension_out=`mktemp`
|
||||||
|
if $(docker run --rm --volume "${TRAVIS_BUILD_DIR}:/app" --workdir /app "${testExtension_Image}" bash -c "./install-php-extensions ${1} && php -r "'"'"exit(extension_loaded('${1}') ? 0 : 1);"'"'"" >"${testExtension_out}" 2>&1); then
|
||||||
|
rm -rf "${testExtension_out}"
|
||||||
|
printf ' - Passed\n'
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
printf ' - FAILED!\n' >&2
|
||||||
|
cat "${testExtension_out}" >&2
|
||||||
|
rm -rf "${testExtension_out}"
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test a new extension line
|
# Test a new extension line
|
||||||
|
|
Loading…
Reference in New Issue