summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-09-23 00:20:23 +0100
committerSam James <sam@gentoo.org>2022-09-23 00:45:43 +0100
commitfa49a60a8a2a169eca8c9cd12c4220988a8fdadc (patch)
treef3196377e6d877fbedf0516ce6f6cf4e7e40833c
parent*/*: use portable Bash shebang (diff)
downloadgcc-config-fa49a60a8a2a169eca8c9cd12c4220988a8fdadc.tar.gz
gcc-config-fa49a60a8a2a169eca8c9cd12c4220988a8fdadc.tar.bz2
gcc-config-fa49a60a8a2a169eca8c9cd12c4220988a8fdadc.zip
tests: use sys-apps/gentoo-functions if available
Gives us nicer looking output. Signed-off-by: Sam James <sam@gentoo.org>
-rwxr-xr-xtests/run_tests25
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/run_tests b/tests/run_tests
index 602aa92..ef38770 100755
--- a/tests/run_tests
+++ b/tests/run_tests
@@ -3,17 +3,24 @@
# Avoid bash localization of error messages
export LC_ALL=C
-ebegin() { printf '%s*%s %s ... ' "${GOOD}" "${NORMAL}" "$*" ; }
-eend() {
- local r=${1:-0}
- shift
- if [[ $r -eq 0 ]] ; then
+functions_script="${EPREFIX}/lib/gentoo/functions.sh"
+source "${functions_script}" || {
+ echo "${argv0}: Could not source ${functions_script}!" 1>&2
+
+ ebegin() { printf '%s*%s %s ... ' "${GOOD}" "${NORMAL}" "$*" ; }
+
+ eend() {
+ local r=${1:-0}
+ shift
+ if [[ $r -eq 0 ]] ; then
printf '[ %sok%s ]\n' "${GOOD}" "${NORMAL}"
- else
- printf '%s [ %s!!%s ]\n' "$*" "${BAD}" "${NORMAL}"
- fi
- return $r
+ else
+ printf '%s [ %s!!%s ]\n' "$*" "${BAD}" "${NORMAL}"
+ fi
+ return $r
+ }
}
+
die() { echo "$*" 1>&2; exit 1; }
vars=( CHOST GCC_CONFIG ROOT TROOT NOCOLOR RC_NOCOLOR )