From patchwork Mon Oct 23 16:56:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 10022855 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 8390F601E8 for ; Mon, 23 Oct 2017 16:59:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 732CC288B8 for ; Mon, 23 Oct 2017 16:59:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67A18283F2; Mon, 23 Oct 2017 16:59:04 +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 DA607283F2 for ; Mon, 23 Oct 2017 16:59:03 +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 1e6g1p-0004GC-Kp; Mon, 23 Oct 2017 16:56:41 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6g1n-0004G6-OH for xen-devel@lists.xenproject.org; Mon, 23 Oct 2017 16:56:39 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id 6C/7F-01785-64F1EE95; Mon, 23 Oct 2017 16:56:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeJIrShJLcpLzFFi42JxWrohUtdN/l2 kwf0P4hbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8anaxNZCq7zV0yf9ZulgfEDTxcjJ4eEgL/E pkW3WUFsNgFliZ+dvWwgtoiAnkTTgeeMXYxcHMwCE5glLrd9ZAdJCAvYSUxZtJIRxGYRUJW4/ HsnWAOvgIXEm5uLmSGGykvsarsINlRIQEGiY/oxJogaQYmTM5+wgNjMAhISB1+8YJ7AyD0LSW oWktQCRqZVjBrFqUVlqUW6RpZ6SUWZ6RkluYmZObqGBqZ6uanFxYnpqTmJScV6yfm5mxiB4VD PwMC4g/HyFr9DjJIcTEqivL9z3kYK8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuD1kXsXKSRYlJqe WpGWmQMMTJi0BAePkgivGEiat7ggMbc4Mx0idYrRkuPQi9t/mDg6bt4Fks9mvm5gFmLJy89Ll RLnVQFpEABpyCjNgxsHi55LjLJSwryMDAwMQjwFqUW5mSWo8q8YxTkYlYR55UCm8GTmlcBtfQ V0EBPQQbL2b0AOKklESEk1MLofzYh5GJic4mX394rvgaN+/K3f+bfc95g468W6ut2Gs+93rRE MFpDQf7DLyXiW6pGFqfWibMdVI3Of2jFLPOa83aHP1tH79oVf7/bWY3ekdLkye1LWz5NZHN+6 1DZ+4Z2qxkCn5YmhN5LY3n2WcQrpse+InFG0oei4ykKnykTV1ydLuKJ1lViKMxINtZiLihMBJ rvdHZkCAAA= X-Env-Sender: prvs=462f4a890=wei.liu2@citrix.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1508777796!106647423!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34777 invoked from network); 23 Oct 2017 16:56:38 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 23 Oct 2017 16:56:38 -0000 X-IronPort-AV: E=Sophos;i="5.43,424,1503360000"; d="scan'208";a="447717756" From: Wei Liu To: Xen-devel Date: Mon, 23 Oct 2017 17:56:33 +0100 Message-ID: <20171023165633.26011-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 v2] 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 --- scripts/build-test.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 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..316419d6b7 --- /dev/null +++ b/scripts/build-test.sh @@ -0,0 +1,53 @@ +#!/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. +# +# Cross-build is not yet supported. + +set -e + +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 + +if git branch | grep -q '^\*.\+detached at'; then + echo "Detached HEAD, aborted" + exit 1 +fi + +BASE=$1; shift +TIP=$1; shift +ORIG_BRANCH=`git rev-parse --abbrev-ref HEAD` + +if ! git merge-base --is-ancestor $BASE $TIP; then + echo "$BASE is not an ancestor of $TIP, aborted" + exit 1 +fi + +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 + make -j4 distclean && ./configure && make -j4 + else + "$@" + fi + echo +done + +echo "Restoring original HEAD" +git checkout $ORIG_BRANCH