public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-projects commit in portage-utils/tests: init.sh
@ 2011-12-22 19:30 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2011-12-22 19:30 UTC (permalink / raw
  To: gentoo-commits

vapier      11/12/22 19:30:46

  Modified:             init.sh
  Log:
  redo test output to get info on a per-test basis

Revision  Changes    Path
1.7                  portage-utils/tests/init.sh

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

Index: init.sh
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/init.sh,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- init.sh	18 Dec 2011 06:49:06 -0000	1.6
+++ init.sh	22 Dec 2011 19:30:46 -0000	1.7
@@ -30,20 +30,40 @@
 
 q -i -q
 
-fail() {
-	echo "${BAD}FAILED:${NORMAL} $*"
-	exit 1
+tret=0
+tpassed=0
+tfailed=0
+
+tfail() {
+	echo "${BAD}FAIL:${NORMAL} $*"
+	: $(( ++tfailed ))
+	tret=1
+	return 1
+}
+tpass() {
+	echo "${GOOD}PASS:${NORMAL} $*"
+	: $(( ++tpassed ))
+	return 0
+}
+tend() {
+	local r=$1; shift
+	[[ $r -eq 0 ]] && tpass "$@" || tfail "$@"
+	return $r
+}
+
+die() {
+	tfail "$@"
+	end
 }
-die() { fail "$@" ; }
 
 skip() {
 	echo "${WARN}SKIPPED:${NORMAL} $*"
 	exit 0
 }
 
-pass() {
-	echo "${GOOD}PASSED:${NORMAL} ${PWD##*/}"
-	exit 0
+end() {
+	echo "${HILITE}${PWD##*/}:${NORMAL} ${tpassed} passes / ${tfailed} fails"
+	exit ${tret}
 }
 
 mktmpdir() {






^ permalink raw reply	[flat|nested] 6+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils/tests: init.sh
@ 2012-10-28  5:58 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2012-10-28  5:58 UTC (permalink / raw
  To: gentoo-commits

vapier      12/10/28 05:58:48

  Modified:             init.sh
  Log:
  always enable colors in tests in dev tree

Revision  Changes    Path
1.8                  portage-utils/tests/init.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?rev=1.8&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?rev=1.8&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?r1=1.7&r2=1.8

Index: init.sh
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/init.sh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- init.sh	22 Dec 2011 19:30:46 -0000	1.7
+++ init.sh	28 Oct 2012 05:58:48 -0000	1.8
@@ -22,6 +22,10 @@
 	: ${ats:=${PWD}/../..}
 	: ${ab:=${atb}/tests/${a}}
 	: ${as:=${ats}/tests/${a}}
+
+	if [[ -z ${GOOD} ]] && [[ -d ${ats}/.git || -d ${ats}/CVS ]] ; then
+		eval $(eval_ecolors) 2>/dev/null
+	fi
 }
 setup_env
 





^ permalink raw reply	[flat|nested] 6+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils/tests: init.sh
@ 2011-12-18  6:49 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2011-12-18  6:49 UTC (permalink / raw
  To: gentoo-commits

vapier      11/12/18 06:49:06

  Modified:             init.sh
  Log:
  add nice colors to test output

Revision  Changes    Path
1.6                  portage-utils/tests/init.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?rev=1.6&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?rev=1.6&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?r1=1.5&r2=1.6

Index: init.sh
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/init.sh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- init.sh	12 Dec 2011 21:16:23 -0000	1.5
+++ init.sh	18 Dec 2011 06:49:06 -0000	1.6
@@ -1,3 +1,5 @@
+. /etc/init.d/functions.sh 2>/dev/null || :
+
 setup_path() {
 	local d=$PWD
 	while [[ $d != "/" ]] ; do
@@ -29,18 +31,18 @@
 q -i -q
 
 fail() {
-	echo "FAILED: $*"
+	echo "${BAD}FAILED:${NORMAL} $*"
 	exit 1
 }
 die() { fail "$@" ; }
 
 skip() {
-	echo "SKIPPED: $*"
+	echo "${WARN}SKIPPED:${NORMAL} $*"
 	exit 0
 }
 
 pass() {
-	echo "PASSED"
+	echo "${GOOD}PASSED:${NORMAL} ${PWD##*/}"
 	exit 0
 }
 






^ permalink raw reply	[flat|nested] 6+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils/tests: init.sh
@ 2011-12-12 21:04 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2011-12-12 21:04 UTC (permalink / raw
  To: gentoo-commits

vapier      11/12/12 21:04:24

  Modified:             init.sh
  Log:
  first pass at integrating the testsuite into autotools code

Revision  Changes    Path
1.4                  portage-utils/tests/init.sh

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

Index: init.sh
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/init.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- init.sh	17 Mar 2011 03:16:45 -0000	1.3
+++ init.sh	12 Dec 2011 21:04:23 -0000	1.4
@@ -1,10 +1,26 @@
-d=$PWD
-while [[ $d != "/" ]] ; do
-	[[ -e $d/q ]] && break
-	d=${d%/*}
-done
-PATH=$d:$PATH
-unset d
+setup_path() {
+	local d=$PWD
+	while [[ $d != "/" ]] ; do
+		[[ -e $d/q ]] && break
+		d=${d%/*}
+	done
+	PATH=$d:$PATH
+}
+setup_path
+
+# matches tests/subdir.mk
+setup_env() {
+	local a=${0%/*}
+	a=${a##*/}
+
+	: ${b:=.}
+	: ${s:=.}
+	: ${atb:=${PWD}/../..}
+	: ${ats:=${PWD}/../..}
+	: ${ab:=${atb}/tests/${a}}
+	: ${as:=${ats}/tests/${a}}
+}
+setup_env
 
 # clean any random vars from the host system
 unset ROOT PORTAGE_CONFIGROOT PORTAGE_QUIET
@@ -17,13 +33,28 @@
 }
 die() { fail "$@" ; }
 
+skip() {
+	echo "SKIPPED: $*"
+	exit 0
+}
+
 pass() {
 	echo "PASSED"
 	exit 0
 }
 
 mktmpdir() {
-	local d=${1:-tmp}
-	rm -rf "$d" && mkdir "$d" && cd "$d" \
-		|| fail "could not make tmp dir '$1'"
+	local d=${1:-${ab}/tmp}
+	rm -rf "$d" && \
+	mkdir -p "$d" && \
+	pushd "$d" >/dev/null \
+		|| fail "could not make tmp dir '$d'"
+}
+_cleantmpdir() {
+	local cmd=$1; shift
+	local d=${1:-${ab}/tmp}
+	popd >/dev/null
+	${cmd} "${d}" || fail "could not clean tmp dir '$d'"
 }
+cleantmpdir() { _cleantmpdir "rm -rf" "$@" ; }
+trimtmpdir() { _cleantmpdir "rmdir" "$@" ; }






^ permalink raw reply	[flat|nested] 6+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils/tests: init.sh
@ 2011-03-17  3:16 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2011-03-17  3:16 UTC (permalink / raw
  To: gentoo-commits

vapier      11/03/17 03:16:45

  Modified:             init.sh
  Log:
  make sure tests run with a clean env

Revision  Changes    Path
1.3                  portage-utils/tests/init.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?r1=1.2&r2=1.3

Index: init.sh
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/init.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- init.sh	2 Mar 2011 01:19:27 -0000	1.2
+++ init.sh	17 Mar 2011 03:16:45 -0000	1.3
@@ -6,6 +6,9 @@
 PATH=$d:$PATH
 unset d
 
+# clean any random vars from the host system
+unset ROOT PORTAGE_CONFIGROOT PORTAGE_QUIET
+
 q -i -q
 
 fail() {






^ permalink raw reply	[flat|nested] 6+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils/tests: init.sh
@ 2011-03-01  4:58 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2011-03-01  4:58 UTC (permalink / raw
  To: gentoo-commits

vapier      11/03/01 04:58:59

  Added:                init.sh
  Log:
  add common test init code

Revision  Changes    Path
1.1                  portage-utils/tests/init.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/init.sh?rev=1.1&content-type=text/plain

Index: init.sh
===================================================================
d=$PWD
while [[ $d != "/" ]] ; do
	[[ -e $d/q ]] && break
	d=${d%/*}
done
PATH=$d:$PATH
unset d

q -i -q

fail() {
	echo "FAILED: $*"
	exit 1
}
die() { fail "$@" ; }

pass() {
	echo "PASSED"
	exit 0
}






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-10-28  5:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-22 19:30 [gentoo-commits] gentoo-projects commit in portage-utils/tests: init.sh Mike Frysinger (vapier)
  -- strict thread matches above, loose matches on Subject: below --
2012-10-28  5:58 Mike Frysinger (vapier)
2011-12-18  6:49 Mike Frysinger (vapier)
2011-12-12 21:04 Mike Frysinger (vapier)
2011-03-17  3:16 Mike Frysinger (vapier)
2011-03-01  4:58 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