From 6fbd39d2fa4250d7ea0a9ed84689d5dde790ba35 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 11 Dec 2018 14:33:31 +0100 Subject: [PATCH] Capture output of test build steps --- scripts/travisci-test-new-extensions | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/travisci-test-new-extensions b/scripts/travisci-test-new-extensions index 447a780..b215d81 100755 --- a/scripts/travisci-test-new-extensions +++ b/scripts/travisci-test-new-extensions @@ -51,11 +51,20 @@ testExtension () { printf 'PHP version: %s\n' "${2}" if test -n "$(printf '%s' "${2}" | sed -E 's/^[0-9]+\.[0-9]+$//')"; then printf ' INVALID PHP VERSION: %s\n' "${2}" >&2 - return 0 + return 1 fi testExtension_Image="$(getExtensionImage "${1}" "${2}")" 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