From patchwork Wed Oct 25 16:00:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 10026953 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 761CC60375 for ; Wed, 25 Oct 2017 16:04:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6393F1FF2D for ; Wed, 25 Oct 2017 16:04:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5856528B75; Wed, 25 Oct 2017 16:04:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5DB3F28B62 for ; Wed, 25 Oct 2017 16:04:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7O7v-0004Tz-1r; Wed, 25 Oct 2017 16:01:55 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7O7t-0004Tt-RX for xen-devel@lists.xenproject.org; Wed, 25 Oct 2017 16:01:53 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id 02/6B-05089-175B0F95; Wed, 25 Oct 2017 16:01:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPLMWRWlGSWpSXmKPExsXitHSDvW7B1g+ RBst3qFp83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmPzn5mKnguUHG/cTN7A+Ml3i5GTg4JAX+J gwfaWEFsNgFliZ+dvWwgtoiAnkTTgeeMXYxcHMwCE5glLrd9ZAdJCAu4S8x5epAZxGYRUJX4e f0+UDMHB6+AhcTG+XUQM+UldrVdBJspJKAg0TH9GBOIzSsgKHFy5hMWEJtZQELi4IsXzBMYuW chSc1CklrAyLSKUaM4tagstUjXyFAvqSgzPaMkNzEzR9fQwFgvN7W4ODE9NScxqVgvOT93EyM wGOoZGBh3MPbs9TvEKMnBpCTKq7PyQ6QQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCV7XLUA5waLU 9NSKtMwcYFjCpCU4eJREeENB0rzFBYm5xZnpEKlTjMYcHTfv/mHieDbzdQOzEEtefl6qlDhvL EipAEhpRmke3CBYvFxilJUS5mVkYGAQ4ilILcrNLEGVf8UozsGoJMyrCTKFJzOvBG7fK6BTmI BOaVIFO6UkESEl1cAYJnOgqFaYo811amSOW9pJ8Qj/f2vW+N8ymhQdmJCtujtqE5t6+N89Yqm 83l+3P3+pHCYzo+b4m5nPoja/PZa0b8ZjHobb9go+n/ex70vzPNYW19XCVDzr/qvvu1tPXRPZ xZd/rzLL9be5Trb/PSX+cstnOSnxstKT5Lk4tk0UvzPJfV3hfT8lluKMREMt5qLiRABmTd/Ik gIAAA== X-Env-Sender: prvs=46425e009=wei.liu2@citrix.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1508947310!111953733!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36333 invoked from network); 25 Oct 2017 16:01:52 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-3.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 25 Oct 2017 16:01:52 -0000 X-IronPort-AV: E=Sophos;i="5.43,432,1503360000"; d="scan'208";a="456023147" From: Wei Liu To: Xen-devel Date: Wed, 25 Oct 2017 17:00:21 +0100 Message-ID: <20171025160021.17991-1-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Anthony PERARD Subject: [Xen-devel] [PATCH v3 for-4.10] scripts: introduce a script for build test X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ian Jackson Signed-off-by: Wei Liu --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu Cc: Julien Grall Cc: Anthony PERARD v3: 1. Use git-clean in default rune. 2. Print more friendly message. 3. Restore HEAD automatically. --- scripts/build-test.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 scripts/build-test.sh diff --git a/scripts/build-test.sh b/scripts/build-test.sh new file mode 100755 index 0000000000..f55ec5d4fa --- /dev/null +++ b/scripts/build-test.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +# Run command on every commit within the range specified. If no command is +# provided, use the default one to clean and build the whole tree. +# +# The default rune is rather simple. To do a cross-build, please put your usual +# build rune in a shell script and invoke it with this script. + +if ! test -f xen/common/kernel.c; then + echo "Please run this script from top-level directory" + exit 1 +fi + +if test $# -lt 2 ; then + echo "Usage: $0 [CMD]" + exit 1 +fi + +status=`git status -s` +if test -n "$status"; then + echo "Tree is dirty, aborted" + exit 1 +fi + +BASE=$1; shift +TIP=$1; shift + +ORIG_BRANCH=`git symbolic-ref -q --short HEAD` +if test $? -ne 0; then + echo "Detached HEAD, aborted" + exit 1 +fi + +trap "echo Restoring original HEAD ; git checkout $ORIG_BRANCH" EXIT + +git rev-list $BASE..$TIP | nl -ba | tac | \ +while read num rev; do + echo "Testing $num $rev" + git checkout $rev + if test $# -eq 0 ; then + git clean -fdx && ./configure && make -j4 + else + "$@" + fi + if test $? -ne 0; then + echo "Failed at $num $rev" + exit 1 + fi + echo +done