1 |
commit: fa49a60a8a2a169eca8c9cd12c4220988a8fdadc |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 22 23:20:23 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 22 23:45:43 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=fa49a60a |
7 |
|
8 |
tests: use sys-apps/gentoo-functions if available |
9 |
|
10 |
Gives us nicer looking output. |
11 |
|
12 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
13 |
|
14 |
tests/run_tests | 25 ++++++++++++++++--------- |
15 |
1 file changed, 16 insertions(+), 9 deletions(-) |
16 |
|
17 |
diff --git a/tests/run_tests b/tests/run_tests |
18 |
index 602aa92..ef38770 100755 |
19 |
--- a/tests/run_tests |
20 |
+++ b/tests/run_tests |
21 |
@@ -3,17 +3,24 @@ |
22 |
# Avoid bash localization of error messages |
23 |
export LC_ALL=C |
24 |
|
25 |
-ebegin() { printf '%s*%s %s ... ' "${GOOD}" "${NORMAL}" "$*" ; } |
26 |
-eend() { |
27 |
- local r=${1:-0} |
28 |
- shift |
29 |
- if [[ $r -eq 0 ]] ; then |
30 |
+functions_script="${EPREFIX}/lib/gentoo/functions.sh" |
31 |
+source "${functions_script}" || { |
32 |
+ echo "${argv0}: Could not source ${functions_script}!" 1>&2 |
33 |
+ |
34 |
+ ebegin() { printf '%s*%s %s ... ' "${GOOD}" "${NORMAL}" "$*" ; } |
35 |
+ |
36 |
+ eend() { |
37 |
+ local r=${1:-0} |
38 |
+ shift |
39 |
+ if [[ $r -eq 0 ]] ; then |
40 |
printf '[ %sok%s ]\n' "${GOOD}" "${NORMAL}" |
41 |
- else |
42 |
- printf '%s [ %s!!%s ]\n' "$*" "${BAD}" "${NORMAL}" |
43 |
- fi |
44 |
- return $r |
45 |
+ else |
46 |
+ printf '%s [ %s!!%s ]\n' "$*" "${BAD}" "${NORMAL}" |
47 |
+ fi |
48 |
+ return $r |
49 |
+ } |
50 |
} |
51 |
+ |
52 |
die() { echo "$*" 1>&2; exit 1; } |
53 |
|
54 |
vars=( CHOST GCC_CONFIG ROOT TROOT NOCOLOR RC_NOCOLOR ) |