From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Rada Subject: [PATCH v2 2/3] gitweb: split test suite into library and tests Date: Tue, 25 Aug 2009 01:00:16 -0400 Message-ID: <4A936FE0.2070208@mailservices.uwaterloo.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org To: Junio C Hamano , Jakub Narebski X-From: git-owner@vger.kernel.org Tue Aug 25 07:01:43 2009 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1MfoAA-0007Ii-Kg for gcvg-git-2@lo.gmane.org; Tue, 25 Aug 2009 07:01:43 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754434AbZHYFB2 (ORCPT ); Tue, 25 Aug 2009 01:01:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753968AbZHYFB2 (ORCPT ); Tue, 25 Aug 2009 01:01:28 -0400 Received: from mailservices.uwaterloo.ca ([129.97.128.141]:41716 "EHLO mailchk-m04.uwaterloo.ca" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753470AbZHYFB1 (ORCPT ); Tue, 25 Aug 2009 01:01:27 -0400 Received: from karakura.local (CPE0018397ddc22-CM001225dfe86e.cpe.net.cable.rogers.com [174.117.223.147]) (authenticated bits=0) by mailchk-m04.uwaterloo.ca (8.13.1/8.13.1) with ESMTP id n7P50HCC019309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Aug 2009 01:00:18 -0400 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 X-UUID: 921c41dc-94d1-4748-ab48-7a9ae963106b X-Miltered: at mailchk-m04 with ID 4A936FE1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Virus-Scanned: clamav-milter 0.95.1 at mailchk-m04 X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mailchk-m04.uwaterloo.ca [129.97.128.141]); Tue, 25 Aug 2009 01:00:19 -0400 (EDT) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Change the subject from saying 'break' to 'split', because break may have given people the wrong idea about what the commit is doing. I also put the test_description back into t9500, having it in gitweb-lib.sh was a mistake. -- Mark A Rada (ferrous26) marada@uwaterloo.ca --->8--- To accommodate additions to the tests cases for gitweb, the preamble from t9500 is now in its own library so that new sets of tests for gitweb can use the same setup without copying the code. Signed-off-by: Mark Rada --- t/gitweb-lib.sh | 73 ++++++++++++++++++++++++++++++++ t/t9500-gitweb-standalone-no-errors.sh | 67 +---------------------------- 2 files changed, 74 insertions(+), 66 deletions(-) create mode 100644 t/gitweb-lib.sh diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh new file mode 100644 index 0000000..8452532 --- /dev/null +++ b/t/gitweb-lib.sh @@ -0,0 +1,73 @@ +#!/bin/sh +# +# Copyright (c) 2007 Jakub Narebski +# + +gitweb_init () { + safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')" + cat >gitweb_config.perl <.git/description <gitweb.output 2>gitweb.log && + if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi + + # gitweb.log is left for debugging + # gitweb.output is used to parse http output +} + +. ./test-lib.sh + +if ! test_have_prereq PERL; then + say 'skipping gitweb tests, perl not available' + test_done +fi + +perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || { + say 'skipping gitweb tests, perl version is too old' + test_done +} + +gitweb_init diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh index 6275181..2fc7fdb 100755 --- a/t/t9500-gitweb-standalone-no-errors.sh +++ b/t/t9500-gitweb-standalone-no-errors.sh @@ -9,73 +9,8 @@ This test runs gitweb (git web interface) as CGI script from commandline, and checks that it would not write any errors or warnings to log.' -gitweb_init () { - safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')" - cat >gitweb_config.perl <.git/description </dev/null 2>gitweb.log && - if grep "^[[]" gitweb.log >/dev/null 2>&1; then false; else true; fi - - # gitweb.log is left for debugging -} - -. ./test-lib.sh - -if ! test_have_prereq PERL; then - say 'skipping gitweb tests, perl not available' - test_done -fi - -perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || { - say 'skipping gitweb tests, perl version is too old' - test_done -} - -gitweb_init +. ./gitweb-lib.sh # ---------------------------------------------------------------------- # no commits (empty, just initialized repository) -- 1.6.4