summaryrefslogtreecommitdiff
path: root/eclass/qt5-build.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/qt5-build.eclass')
-rw-r--r--eclass/qt5-build.eclass31
1 files changed, 16 insertions, 15 deletions
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 284febfa59a0..8665f3bfe30c 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -246,13 +246,11 @@ qt5-build_src_test() {
_EOF_
chmod +x "${testrunner}"
- local testcmd=(
- qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check
- )
+ set -- qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check
if [[ ${VIRTUALX_REQUIRED} == test ]]; then
- virtx "${testcmd[@]}"
+ virtx "$@"
else
- "${testcmd[@]}"
+ "$@"
fi
}
@@ -417,28 +415,31 @@ qt5_prepare_env() {
# @FUNCTION: qt5_foreach_target_subdir
# @INTERNAL
# @DESCRIPTION:
-# Executes the arguments inside each directory listed in QT5_TARGET_SUBDIRS.
+# Executes the command given as argument from inside each directory
+# listed in QT5_TARGET_SUBDIRS. Handles autotests subdirs automatically.
qt5_foreach_target_subdir() {
[[ -z ${QT5_TARGET_SUBDIRS[@]} ]] && QT5_TARGET_SUBDIRS=("")
- local ret=0 subdir=
+ local die_args=()
+ [[ ${EAPI} != 5 ]] && die_args+=(-n)
+
+ local subdir=
for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
if [[ ${EBUILD_PHASE} == test ]]; then
subdir=tests/auto${subdir#src}
[[ -d ${S}/${subdir} ]] || continue
fi
- mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die
- pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
+ local msg="Running $* ${subdir:+in ${subdir}}"
+ einfo "${msg}"
- einfo "Running $* ${subdir:+in ${subdir}}"
- "$@"
- ((ret+=$?))
+ mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die "${die_args[@]}" || return $?
+ pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die "${die_args[@]}" || return $?
- popd >/dev/null || die
- done
+ "$@" || die "${die_args[@]}" "${msg} failed" || return $?
- return ${ret}
+ popd >/dev/null || die "${die_args[@]}" || return $?
+ done
}
# @FUNCTION: qt5_symlink_tools_to_build_dir