This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] contrib/patch_tester.sh, 5 of 7


This patch to contrib/patch_tester.sh adds a new mode for the tool in
which it will stop when there are no further patches to test.  I've been
using this with an automated build and test system where the usual mode
of running continuously isn't practical.

Sebastian, OK for trunk?

--- patch_tester.sh.4	2008-03-05 15:29:31.000000000 -0800
+++ patch_tester.sh	2008-03-05 15:29:34.000000000 -0800
@@ -37,11 +37,12 @@ default_watermark=0.60
 watermark=$default_watermark
 savecompilers=false
 nogpg=false
+stop=false
 
 usage() {
     cat <<EOF
 patch_tester.sh [-j<N>] [-standby N] [-watermark N] [-savecompilers] [-nogpg]
-                [-svnpath URL]
+                [-svnpath URL] [-stop]
                 <source_dir> [patches_dir [state_dir [build_dir]]]
 
     J is the flag passed to make.  Default is empty string.
@@ -61,6 +62,8 @@ patch_tester.sh [-j<N>] [-standby N] [-w
     URL is the location of the GCC SVN repository.  The default is
     ${svnpath}.
 
+    STOP exits when PATCHES_DIR is empty.
+
     SOURCE_DIR is the directory containing GCC's toplevel configure.
 
     PATCHES_DIR is the directory containing the patches to be tested.
@@ -104,6 +107,9 @@ while [ $# -ne 0 ]; do
 	-nogpg)
 	    nogpg=true; shift
 	    ;;
+	-stop)
+	    stop=true; shift
+	    ;;
 	-svnpath)
 	    svnpath=$2; shift; shift
 	    ;;
@@ -451,11 +457,22 @@ if [ -d $TESTING ]; then
     fi
 fi
 
+firstpatch=true
 while true; do
     PATCH=`ls -rt -1 $PATCHES | head -1`
     if [ x$PATCH = x ]; then
+	if [ $stop = true ]; then
+	    if [ $firstpatch = true ]; then
+		echo "No patches ready to test, quitting."
+		exit 1
+	    else
+		echo "No more patches to test."
+		exit 0
+	    fi
+	fi
 	sleep ${standby}m
     else
+	firstpatch=false
 	sysload=`uptime | cut -d, -f 5`
 	if [[ $sysload > $watermark ]]; then
 	    # Wait a bit when system load is too high.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]