From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 51A3E158094 for ; Thu, 22 Sep 2022 23:46:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0E8F6E0AF8; Thu, 22 Sep 2022 23:46:22 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E8A7BE0AF8 for ; Thu, 22 Sep 2022 23:46:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F3872340BC0 for ; Thu, 22 Sep 2022 23:46:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8F9335CD for ; Thu, 22 Sep 2022 23:46:19 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1663890343.fa49a60a8a2a169eca8c9cd12c4220988a8fdadc.sam@gentoo> Subject: [gentoo-commits] proj/gcc-config:master commit in: tests/ X-VCS-Repository: proj/gcc-config X-VCS-Files: tests/run_tests X-VCS-Directories: tests/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: fa49a60a8a2a169eca8c9cd12c4220988a8fdadc X-VCS-Branch: master Date: Thu, 22 Sep 2022 23:46:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d36cef66-4c4c-40d5-a0dc-557023d3defa X-Archives-Hash: 0f1c84dc2f7db7108fcd741f83ab558c commit: fa49a60a8a2a169eca8c9cd12c4220988a8fdadc Author: Sam James gentoo org> AuthorDate: Thu Sep 22 23:20:23 2022 +0000 Commit: Sam James gentoo org> CommitDate: Thu Sep 22 23:45:43 2022 +0000 URL: https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=fa49a60a tests: use sys-apps/gentoo-functions if available Gives us nicer looking output. Signed-off-by: Sam James gentoo.org> tests/run_tests | 25 ++++++++++++++++--------- 1 file 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 )