diff options
| author | Michael Palimaka <kensington@gentoo.org> | 2014-02-06 01:23:46 +1100 |
|---|---|---|
| committer | Michael Palimaka <kensington@gentoo.org> | 2014-02-06 01:23:46 +1100 |
| commit | 0836e9145e25c82efe722b331a4b1579615cc319 (patch) | |
| tree | 0a30825be7833378b558f4285565cfa9dde6bd35 /eclass/cmake-utils.eclass | |
| parent | 6dff9f6c31903e5320450cf6b27267f2282e0d2a (diff) | |
| download | kde-0836e9145e25c82efe722b331a4b1579615cc319.tar.gz kde-0836e9145e25c82efe722b331a4b1579615cc319.tar.bz2 kde-0836e9145e25c82efe722b331a4b1579615cc319.zip | |
[eclass] src_test comes before src_install
Diffstat (limited to 'eclass/cmake-utils.eclass')
| -rw-r--r-- | eclass/cmake-utils.eclass | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index 31f41c5d078..180c3704726 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -595,6 +595,37 @@ cmake-utils_src_make() { popd > /dev/null } +enable_cmake-utils_src_test() { + debug-print-function ${FUNCNAME} "$@" + + _check_build_dir + pushd "${BUILD_DIR}" > /dev/null + [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; } + + [[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure ) + + if ctest "${myctestargs[@]}" "$@" ; then + einfo "Tests succeeded." + popd > /dev/null + return 0 + else + if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then + # on request from Diego + eerror "Tests failed. Test log ${BUILD_DIR}/Testing/Temporary/LastTest.log follows:" + eerror "--START TEST LOG--------------------------------------------------------------" + cat "${BUILD_DIR}/Testing/Temporary/LastTest.log" + eerror "--END TEST LOG----------------------------------------------------------------" + die "Tests failed." + else + die "Tests failed. When you file a bug, please attach the following file: \n\t${BUILD_DIR}/Testing/Temporary/LastTest.log" + fi + + # die might not die due to nonfatal + popd > /dev/null + return 1 + fi +} + enable_cmake-utils_src_install() { debug-print-function ${FUNCNAME} "$@" @@ -631,37 +662,6 @@ enable_cmake-utils_src_install() { popd > /dev/null } -enable_cmake-utils_src_test() { - debug-print-function ${FUNCNAME} "$@" - - _check_build_dir - pushd "${BUILD_DIR}" > /dev/null - [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; } - - [[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure ) - - if ctest "${myctestargs[@]}" "$@" ; then - einfo "Tests succeeded." - popd > /dev/null - return 0 - else - if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then - # on request from Diego - eerror "Tests failed. Test log ${BUILD_DIR}/Testing/Temporary/LastTest.log follows:" - eerror "--START TEST LOG--------------------------------------------------------------" - cat "${BUILD_DIR}/Testing/Temporary/LastTest.log" - eerror "--END TEST LOG----------------------------------------------------------------" - die "Tests failed." - else - die "Tests failed. When you file a bug, please attach the following file: \n\t${BUILD_DIR}/Testing/Temporary/LastTest.log" - fi - - # die might not die due to nonfatal - popd > /dev/null - return 1 - fi -} - # @FUNCTION: cmake-utils_src_prepare # @DESCRIPTION: # Apply ebuild and user patches. @@ -685,13 +685,6 @@ cmake-utils_src_compile() { _execute_optionaly "src_compile" "$@" } -# @FUNCTION: cmake-utils_src_install -# @DESCRIPTION: -# Function for installing the package. Automatically detects the build type. -cmake-utils_src_install() { - _execute_optionaly "src_install" "$@" -} - # @FUNCTION: cmake-utils_src_test # @DESCRIPTION: # Function for testing the package. Automatically detects the build type. @@ -699,6 +692,13 @@ cmake-utils_src_test() { _execute_optionaly "src_test" "$@" } +# @FUNCTION: cmake-utils_src_install +# @DESCRIPTION: +# Function for installing the package. Automatically detects the build type. +cmake-utils_src_install() { + _execute_optionaly "src_install" "$@" +} + # Optionally executes phases based on WANT_CMAKE variable/USE flag. _execute_optionaly() { local phase="$1" ; shift |
