Skip to content

Commit

Permalink
Tune up build-test-ext.sh [skip appveyor]
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Nov 13, 2018
1 parent ae413b0 commit b802c8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
24 changes: 11 additions & 13 deletions .ci/build-test-ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,20 @@ DEFAULT_ZFLAGS="-Wnonexistent-function -Wnonexistent-class -Wunused-variable"

shopt -s nullglob

cd "${PROJECT_ROOT}"
./zephir clean 2>&1
./zephir fullclean 2>&1
./zephir generate ${DEFAULT_ZFLAGS} 2>&1
./zephir stubs 2>&1
./zephir api 2>&1

${PROJECT_ROOT}/zephir clean 2>&1
${PROJECT_ROOT}/zephir fullclean 2>&1
${PROJECT_ROOT}/zephir generate ${DEFAULT_ZFLAGS} 2>&1
${PROJECT_ROOT}/zephir stubs 2>&1
${PROJECT_ROOT}/zephir api 2>&1

cd "${PROJECT_ROOT}/ext"
cd ext

phpize

CFLAGS="${CFLAGS}"
LDFLAGS="${LDFLAGS}"

if [ "x${REPORT_COVERAGE}" = "x1" ]; then
if [ "${REPORT_COVERAGE}" = "1" ]; then
# The ltmain.sh which bundled with PHP it's from libtool 1.5.26.
# However, the version of libtool that claims to no longer remove
# ".gcno" profiler information is libtool 2.2.6. The fix is probably
Expand All @@ -53,11 +51,11 @@ fi

make -j"$(getconf _NPROCESSORS_ONLN)"

if [ "x${REPORT_COVERAGE}" = "x1" ]; then
output=${PROJECT_ROOT}/unit-tests/output/coverage.info
cd ..

lcov --directory ${PROJECT_ROOT}/ext --zerocounters
lcov --directory ${PROJECT_ROOT}/ext --capture --compat-libtool --initial --output-file ${output}
if [ "${REPORT_COVERAGE}" = "1" ]; then
lcov --directory ./ext --zerocounters
lcov --directory ./ext --capture --compat-libtool --initial --output-file ./unit-tests/output/coverage.info
fi

exit $?
12 changes: 3 additions & 9 deletions .ci/install-prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ install_ext_from_src () {
cd `dirname ${downloaddir}`

if [ ! -d "${pkgname}-${PHP_VERNUM}" ]; then
git clone --depth=1 -v "${source}" "${pkgname}-${PHP_VERNUM}"
git clone --depth=1 -v -b master "${source}" "${pkgname}-${PHP_VERNUM}"
fi

if [ ! -f "${pkgname}-${PHP_VERNUM}/LICENSE" ]; then
echo "Unable to locate ${pkgname}-${PHP_VERNUM}/LICENSE file. Stop."
if [ ! -f "${pkgname}-${PHP_VERNUM}/config.m4" ]; then
echo "Unable to locate ${pkgname}-${PHP_VERNUM}/config.m4 file. Stop."
exit 1
fi

Expand Down Expand Up @@ -70,9 +70,3 @@ install_ext_from_src () {
}

install_ext_from_src "zephir_parser" "https://github.com/phalcon/php-zephir-parser" ""

if [ "${PHP_VERNUM}" -ge 70300 ]; then
install_ext_from_src "memcached" "https://github.com/php-memcached-dev/php-memcached" "--disable-memcached-sasl"
else
echo 'extension="memcached.so"' > "$(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/memcached.ini"
fi

0 comments on commit b802c8a

Please sign in to comment.