Hello, I'd like to add the tests-common*() family of functions to the eclass/tests/tests-common.sh file as required for clean (garbage-free) run of scons-utils tests.
I'm attaching the patch. Does anyone have any objections or suggestions? The code was based on one used in Portage. -- Best regards, Michał Górny
? tests-add-debug-print.diff
Index: tests-common.sh
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/tests-common.sh,v
retrieving revision 1.1
diff -u -r1.1 tests-common.sh
--- tests-common.sh 2 Jan 2008 01:01:18 -0000 1.1
+++ tests-common.sh 9 Oct 2010 15:15:15 -0000
@@ -8,3 +8,26 @@
source ../${e}.eclass
done
}
+
+debug-print() {
+ while [[ ${1} ]]; do
+ # extra user-configurable targets
+ if [[ ${ECLASS_DEBUG_OUTPUT} = on ]]; then
+ echo "debug: ${1}" >&2
+ elif [[ -n ${ECLASS_DEBUG_OUTPUT} ]]; then
+ echo "debug: ${1}" >> "${ECLASS_DEBUG_OUTPUT}"
+ fi
+
+ shift
+ done
+}
+
+debug-print-function() {
+ local f="${1}: entering function"
+ shift
+ debug-print "${f}, parameters: ${*}"
+}
+
+debug-print-section() {
+ debug-print "now in section ${*}"
+}
signature.asc
Description: PGP signature
