public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in eclass/tests: autotools:eaclocal_amflags.sh eutils:path_exists.sh scons-utils.sh tests-common.sh toolchain-funcs.sh
@ 2011-12-15  0:15 Mike Frysinger (vapier)
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2011-12-15  0:15 UTC (permalink / raw
  To: gentoo-commits

vapier      11/12/15 00:15:09

  Modified:             autotools:eaclocal_amflags.sh eutils:path_exists.sh
                        scons-utils.sh tests-common.sh toolchain-funcs.sh
  Log:
  add some test status helpers to simplify management of i/o and exit status

Revision  Changes    Path
1.2                  eclass/tests/autotools:eaclocal_amflags.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/autotools:eaclocal_amflags.sh?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/autotools:eaclocal_amflags.sh?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/autotools:eaclocal_amflags.sh?r1=1.1&r2=1.2

Index: autotools:eaclocal_amflags.sh
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/autotools:eaclocal_amflags.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- autotools:eaclocal_amflags.sh	23 Sep 2011 04:14:02 -0000	1.1
+++ autotools:eaclocal_amflags.sh	15 Dec 2011 00:15:08 -0000	1.2
@@ -5,11 +5,11 @@
 inherit autotools
 
 test-it() {
-	ebegin "Testing eaclocal_amflags $1: $2"
+	tbegin "eaclocal_amflags $1: $2"
 	printf "ACLOCAL_AMFLAGS = %b\n" "$2" > Makefile.am
 	local flags=$(eaclocal_amflags) exp=${3:-$2}
 	[[ "${flags}" == "${exp}" ]]
-	if ! eend $? ; then
+	if ! tend $? ; then
 		printf '### INPUT:\n%s\n' "$2"
 		printf '### FILE:\n%s\n' "$(<Makefile.am)"
 		printf '### EXPECTED:\n%s\n' "${exp}"
@@ -25,3 +25,5 @@
 test-it shell-exec '`echo {0..3}`' "0 1 2 3"
 
 test-it multiline '-I oneline \\\n\t-I twoline' "-I oneline -I twoline"
+
+texit



1.2                  eclass/tests/eutils:path_exists.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/eutils:path_exists.sh?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/eutils:path_exists.sh?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/eutils:path_exists.sh?r1=1.1&r2=1.2

Index: eutils:path_exists.sh
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/eutils:path_exists.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- eutils:path_exists.sh	17 Oct 2010 21:37:03 -0000	1.1
+++ eutils:path_exists.sh	15 Dec 2011 00:15:08 -0000	1.2
@@ -4,15 +4,12 @@
 
 inherit eutils
 
-tret=0
-
 test-path_exists() {
 	local exp=$1; shift
-	ebegin "Testing path_exists($*) == ${exp}"
+	tbegin "path_exists($*) == ${exp}"
 	path_exists "$@"
 	[[ ${exp} -eq $? ]]
-	eend $?
-	: $(( tret |= $? ))
+	tend $?
 }
 
 test-path_exists 1
@@ -33,4 +30,4 @@
 test-path_exists 1 -a ${good} ${bad}
 test-path_exists 0 -o ${good} ${bad}
 
-(exit ${tret})
+texit



1.4                  eclass/tests/scons-utils.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/scons-utils.sh?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/scons-utils.sh?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/scons-utils.sh?r1=1.3&r2=1.4

Index: scons-utils.sh
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/scons-utils.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- scons-utils.sh	30 Oct 2011 14:23:29 -0000	1.3
+++ scons-utils.sh	15 Dec 2011 00:15:09 -0000	1.4
@@ -26,7 +26,7 @@
 # failed test counter
 failed=0
 
-ebegin "Testing scons_clean_makeopts()"
+tbegin "scons_clean_makeopts()"
 
 # sane MAKEOPTS
 test-scons_clean_makeopts '--jobs=14 -k'
@@ -56,4 +56,6 @@
 test-scons_clean_makeopts '--jobs -l3' "--jobs=${jc}"
 test-scons_clean_makeopts '-j -l3' "-j ${jc}"
 
-eend ${failed}
+tend ${failed}
+
+texit



1.7                  eclass/tests/tests-common.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/tests-common.sh?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/tests-common.sh?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/tests-common.sh?r1=1.6&r2=1.7

Index: tests-common.sh
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/tests-common.sh,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- tests-common.sh	15 Dec 2011 00:12:46 -0000	1.6
+++ tests-common.sh	15 Dec 2011 00:15:09 -0000	1.7
@@ -87,3 +87,15 @@
 
 	return 1
 }
+
+tret=0
+tbegin() {
+	ebegin "Testing $*"
+}
+texit() {
+	exit ${tret}
+}
+tend() {
+	eend "$@"
+	: $(( tret |= $? ))
+}



1.3                  eclass/tests/toolchain-funcs.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain-funcs.sh?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain-funcs.sh?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain-funcs.sh?r1=1.2&r2=1.3

Index: toolchain-funcs.sh
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/toolchain-funcs.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- toolchain-funcs.sh	1 Jun 2008 10:16:01 -0000	1.2
+++ toolchain-funcs.sh	15 Dec 2011 00:15:09 -0000	1.3
@@ -22,23 +22,23 @@
 	done
 	return ${ret}
 }
-ebegin "Testing tc-arch-kernel() (KV=2.6.0)"
+tbegin "tc-arch-kernel() (KV=2.6.0)"
 test-tc-arch-kernel 2.6.0 \
 	alpha arm{,eb}:arm avr32 bfin:blackfin cris hppa:parisc \
 	i{3..6}86:i386 ia64 m68k mips{,eb}:mips nios2 powerpc:ppc powerpc64:ppc64 \
 	s390{,x}:s390 sh{1..4}{,eb}:sh sparc{,64} vax x86_64 \
 	i{3..6}86-gentoo-freebsd:i386
-eend $?
-ebegin "Testing tc-arch-kernel() (KV=2.6.30)"
+tend $?
+tbegin "tc-arch-kernel() (KV=2.6.30)"
 test-tc-arch-kernel 2.6.30 \
 	i{3..6}86:x86 x86_64:x86 \
 	powerpc{,64}:powerpc i{3..6}86-gentoo-freebsd:i386
-eend $?
+tend $?
 
 #
 # TEST: tc-arch
 #
-ebegin "Testing tc-arch"
+tbegin "tc-arch"
 ret=0
 for CHOST in \
 	alpha arm{,eb}:arm avr32:avr bfin cris hppa i{3..6}86:x86 ia64 m68k \
@@ -54,4 +54,6 @@
 		((++ret))
 	fi
 done
-eend ${ret}
+tend ${ret}
+
+texit






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-15  0:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15  0:15 [gentoo-commits] gentoo-x86 commit in eclass/tests: autotools:eaclocal_amflags.sh eutils:path_exists.sh scons-utils.sh tests-common.sh toolchain-funcs.sh Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox