From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1P7jzC-0001kk-1Z for garchives@archives.gentoo.org; Mon, 18 Oct 2010 07:18:22 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 846E1E0837; Mon, 18 Oct 2010 07:18:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5F9CBE0837 for ; Mon, 18 Oct 2010 07:18:17 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id DCF661B4072 for ; Mon, 18 Oct 2010 07:18:16 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2279) id CFD6E20051; Mon, 18 Oct 2010 07:18:14 +0000 (UTC) From: "Michal Gorny (mgorny)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, mgorny@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass/tests: tests-common.sh X-VCS-Repository: gentoo-x86 X-VCS-Files: tests-common.sh X-VCS-Directories: eclass/tests X-VCS-Committer: mgorny X-VCS-Committer-Name: Michal Gorny Content-Type: text/plain; charset=utf8 Message-Id: <20101018071814.CFD6E20051@flycatcher.gentoo.org> Date: Mon, 18 Oct 2010 07:18:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 96582d19-99dd-4098-8fcd-c625e2d5a774 X-Archives-Hash: 99fd33c7932efb8b41abfa73875c70ec mgorny 10/10/18 07:18:14 Modified: tests-common.sh Log: Implement debug-print*() family of functions for tests. Revision Changes Path 1.3 eclass/tests/tests-common.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/tests= -common.sh?rev=3D1.3&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/tests= -common.sh?rev=3D1.3&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/tests= -common.sh?r1=3D1.2&r2=3D1.3 Index: tests-common.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/tests/tests-common.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- tests-common.sh 17 Oct 2010 21:36:18 -0000 1.2 +++ tests-common.sh 18 Oct 2010 07:18:14 -0000 1.3 @@ -9,5 +9,23 @@ done } =20 +debug-print() { + [[ ${#} -eq 0 ]] && return + =09 + if [[ ${ECLASS_DEBUG_OUTPUT} =3D=3D on ]]; then + printf 'debug: %s\n' "${@}" >&2 + elif [[ -n ${ECLASS_DEBUG_OUTPUT} ]]; then + printf 'debug: %s\n' "${@}" >> "${ECLASS_DEBUG_OUTPUT}" + fi +} + +debug-print-function() { + debug-print "${1}, parameters: ${*:2}" +} + +debug-print-section() { + debug-print "now in section ${*}" +} + hasq() { [[ " ${*:2} " =3D=3D *" $1 "* ]]; } has() { hasq "$@"; }