aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Savoye <rob.savoye@linaro.org>2014-04-28 15:46:22 -0600
committerRob Savoye <rob.savoye@linaro.org>2014-04-28 15:46:22 -0600
commit15ac96b9b364f3e05bfca518627f9d7a4fc9e305 (patch)
treef49e9ae48e476fdaa5dcc1a051075dc0bcdc9e86
parent9fb0ebecafee4210711384725d8e85fd2c6a9740 (diff)
new script to validate multiple revisions
Change-Id: I67a95eebff284f4ff6f095117ffaa5cb9539826e
-rwxr-xr-xvalidate.sh97
1 files changed, 97 insertions, 0 deletions
diff --git a/validate.sh b/validate.sh
new file mode 100755
index 00000000..9234e5c6
--- /dev/null
+++ b/validate.sh
@@ -0,0 +1,97 @@
+#!/bin/bash
+#
+# Copyright (C) 2013, 2014 Linaro, Inc
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+# load the configure file produced by configure
+if test -e "${PWD}/host.conf"; then
+ . "${PWD}/host.conf"
+else
+ echo "Error: this script needs to be run from a configured Cbuild2 tree!" 1>&2
+fi
+
+if test $# -lt 4; then
+ echo "ERROR: No revisions to build!"
+ echo "validate.sh --target triplet 1111 2222 [3333...]"
+ exit
+fi
+
+# For each revision we build the toolchain for this config triplet
+if test `echo $* | grep -c target` -eq 0; then
+ echo "ERROR: No target to build!"
+ echo "validate.sh --target triplet 1111 2222 [3333...]"
+ exit
+fi
+shift
+target=$1
+shift
+
+# load commonly used functions
+cbuild="`which $0`"
+topdir="${cbuild_path}"
+cbuild2="`basename $0`"
+
+. "${topdir}/lib/diff.sh" || exit 1
+
+# Get the list of revisions to build and compare
+declare -a revisions=($*)
+
+# Get the path for the other scripts.
+fullpath="`which $0`"
+cbuild2="`dirname ${fullpath}`/cbuild2.sh"
+tcwgweb="`dirname ${fullpath}`/tcwgweb.sh"
+
+# We'll move all the results to subdirectories under here
+resultsdir="${local_builds}/test-results"
+mkdir -p ${resultsdir}
+
+# Build all the specified revisions.
+i=0
+while test $i -lt ${#revisions[@]}; do
+ stamps="`ls -C1 ${local_builds}/${build}/${target}/*-stage2-build.stamp`"
+ # if test "`echo ${stamps} | grep -c ${revisions[$i]}`" -eq 0; then
+ # ${cbuild2} --target ${target} --check gcc=gcc.git@${revisions[$i]} --build all
+ # fi
+ sums="`find ${local_builds}/${build}/${target} -name \*.sum`"
+ if test x"${sums}" != x; then
+ mkdir -p ${resultsdir}/cbuild${revisions[$i]}/${build}-${target}
+ #cp ${sums} ${resultsdir}/cbuild${revisions[$i]}/${build}-${target}
+ # We don't need these files leftover from the DejaGnu testsuite
+ # itself.
+ #xz -f ${resultsdir}/cbuild${revisions[$i]}/${build}-${target}/*.sum
+ rm ${resultsdir}/cbuild${revisions[$i]}/${build}-${target}/{x,xXx,testrun}.sum
+ fi
+ i=`expr $i + 1`
+done
+
+# Compare the test results. If we only have 2, just do those. If there
+# is a series, do them all in the order they were specified on the
+# command line.
+if test ${#revisions[@]} -eq 2; then
+ difftwodirs ${resultsdir}/cbuild${revisions[0]} ${resultsdir}/cbuild${revisions[1]}
+else
+ j=0
+ while test $j -lt ${#revisions[@]}; do
+ first=cbuild${revisions[$j]}/${build}-${target}
+ j=`expr $j + 1`
+ second=cbuild${revisions[$j]}/${build}-${target}
+ if test x"${second}" = x; then
+ break
+ else
+ difftwodirs ${resultsdir}/${first} ${resultsdir}/${second}
+ fi
+ done
+fi