public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] MAKEALL: Add summary information
@ 2009-09-18 22:36 Peter Tyser
  2009-09-18 23:35 ` Mike Frysinger
  2009-09-20 22:04 ` Wolfgang Denk
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Tyser @ 2009-09-18 22:36 UTC (permalink / raw)
  To: u-boot

This change adds some basic summary information to the MAKEALL script.
The summary information includes how many boards were compiled, how many
boards had compile warnings or errors, and which specific boards had
compile warnings or errors.

This information is useful when doing compile testing to quickly
determine which boards are broken.

As a side benefit, no empty $BOARD.ERR files are generated by MAKEALL.
Previously, each board had a corresponding $BOARD.ERR file, even if the
board compiled cleanly.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
 MAKEALL |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/MAKEALL b/MAKEALL
index 1d50c34..d7c90ec 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -1,5 +1,8 @@
 #!/bin/sh
 
+# Print statistics when ctrl-c is pressed
+trap "print_stats; exit " 2
+
 # Determine number of CPU cores if no default was set
 : ${BUILD_NCPUS:="`getconf _NPROCESSORS_ONLN`"}
 
@@ -31,6 +34,11 @@ fi
 
 LIST=""
 
+# Keep track of the number of builds and errors
+ERR_CNT=0
+ERR_LIST=""
+TOTAL_CNT=0
+
 #########################################################################
 ## MPC5xx Systems
 #########################################################################
@@ -898,8 +906,14 @@ build_target() {
 	${MAKE} distclean >/dev/null
 	${MAKE} ${target}_config
 
-	${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
-				| tee ${LOG_DIR}/$target.ERR
+	ERR=$(${MAKE} ${JOBS} all 2>&1 > ${LOG_DIR}/$target.MAKELOG)
+	if [ "${ERR}" ] ; then
+		echo "$ERR" | tee ${LOG_DIR}/$target.ERR
+		ERR_CNT=`expr ${ERR_CNT} + 1`
+		ERR_LIST="${ERR_LIST} $target"
+	fi
+
+	TOTAL_CNT=`expr ${TOTAL_CNT} + 1`
 
 	${CROSS_COMPILE}size ${BUILD_DIR}/u-boot \
 				| tee -a ${LOG_DIR}/$target.MAKELOG
@@ -907,7 +921,17 @@ build_target() {
 
 #-----------------------------------------------------------------------
 
+print_stats() {
+	echo ""
+	echo "--------------------- SUMMARY ----------------------------"
+	echo "Boards compiled: ${TOTAL_CNT}"
+	if [ ${ERR_CNT} -gt 0 ] ; then
+		echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
+	fi
+	echo "----------------------------------------------------------"
+}
 
+#-----------------------------------------------------------------------
 for arg in $@
 do
 	case "$arg" in
@@ -931,4 +955,6 @@ do
 	*)		build_target ${arg}
 			;;
 	esac
+
+	print_stats
 done
-- 
1.6.2.1

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

* [U-Boot] [PATCH] MAKEALL: Add summary information
  2009-09-18 22:36 [U-Boot] [PATCH] MAKEALL: Add summary information Peter Tyser
@ 2009-09-18 23:35 ` Mike Frysinger
  2009-09-20 22:04 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2009-09-18 23:35 UTC (permalink / raw)
  To: u-boot

On Friday 18 September 2009 18:36:54 Peter Tyser wrote:
> +TOTAL_CNT=0
> +	TOTAL_CNT=`expr ${TOTAL_CNT} + 1`

do you have an aversion to using POSIX math ?

: $((TOTAL_CNT += 1))
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090918/4aa05ef6/attachment.pgp 

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

* [U-Boot] [PATCH] MAKEALL: Add summary information
  2009-09-18 22:36 [U-Boot] [PATCH] MAKEALL: Add summary information Peter Tyser
  2009-09-18 23:35 ` Mike Frysinger
@ 2009-09-20 22:04 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2009-09-20 22:04 UTC (permalink / raw)
  To: u-boot

Dear Peter Tyser,

In message <1253313414-6907-1-git-send-email-ptyser@xes-inc.com> you wrote:
> This change adds some basic summary information to the MAKEALL script.
> The summary information includes how many boards were compiled, how many
> boards had compile warnings or errors, and which specific boards had
> compile warnings or errors.
> 
> This information is useful when doing compile testing to quickly
> determine which boards are broken.
> 
> As a side benefit, no empty $BOARD.ERR files are generated by MAKEALL.
> Previously, each board had a corresponding $BOARD.ERR file, even if the
> board compiled cleanly.

OK, one concern, though:

> +	ERR=$(${MAKE} ${JOBS} all 2>&1 > ${LOG_DIR}/$target.MAKELOG)

Please do not attempt to buffer the output in a shell variable.
Besindes bash's nasty ways of dealing with single and double quotes,
this may eventually overrun memory limitations. Please use a (temp)
file instead.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Save yourself!  Reboot in 5 seconds!

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

end of thread, other threads:[~2009-09-20 22:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-18 22:36 [U-Boot] [PATCH] MAKEALL: Add summary information Peter Tyser
2009-09-18 23:35 ` Mike Frysinger
2009-09-20 22:04 ` Wolfgang Denk

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