Merge branch 'bg/maint-gitweb-test-lib'
authorJunio C Hamano <gitster@pobox.com>
Wed, 17 Nov 2010 23:01:37 +0000 (15:01 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Nov 2010 23:01:37 +0000 (15:01 -0800)
* bg/maint-gitweb-test-lib:
t/gitweb-lib: Don't pass constant to decode_utf8

Conflicts:
t/gitweb-lib.sh

1  2 
t/gitweb-lib.sh
diff --combined t/gitweb-lib.sh
index 8b5b987f45853da5d24148acc398b838ada7e616,1b9523d02f3a8e785b0823a1d58dfaa22837ba39..b9bb95feaa5088254b002c2806c2c2ae9e9d7be4
@@@ -19,9 -19,9 +19,9 @@@ our \$site_name = '[localhost]'
  our \$site_header = '';
  our \$site_footer = '';
  our \$home_text = 'indextext.html';
 -our @stylesheets = ('file:///$TEST_DIRECTORY/../gitweb/static/gitweb.css');
 -our \$logo = 'file:///$TEST_DIRECTORY/../gitweb/static/git-logo.png';
 -our \$favicon = 'file:///$TEST_DIRECTORY/../gitweb/static/git-favicon.png';
 +our @stylesheets = ('file:///$GIT_BUILD_DIR/gitweb/static/gitweb.css');
 +our \$logo = 'file:///$GIT_BUILD_DIR/gitweb/static/git-logo.png';
 +our \$favicon = 'file:///$GIT_BUILD_DIR/gitweb/static/git-favicon.png';
  our \$projects_list = '';
  our \$export_ok = '';
  our \$strict_export = '';
@@@ -32,34 -32,17 +32,34 @@@ EO
        cat >.git/description <<EOF
  $0 test repository
  EOF
 +
 +      # You can set the GITWEB_TEST_INSTALLED environment variable to
 +      # the gitwebdir (the directory where gitweb is installed / deployed to)
 +      # of an existing gitweb instalation to test that installation,
 +      # or simply to pathname of installed gitweb script.
 +      if test -n "$GITWEB_TEST_INSTALLED" ; then
 +              if test -d $GITWEB_TEST_INSTALLED; then
 +                      SCRIPT_NAME="$GITWEB_TEST_INSTALLED/gitweb.cgi"
 +              else
 +                      SCRIPT_NAME="$GITWEB_TEST_INSTALLED"
 +              fi
 +              test -f "$SCRIPT_NAME" ||
 +              error "Cannot find gitweb at $GITWEB_TEST_INSTALLED."
 +              say "# Testing $SCRIPT_NAME"
 +      else # normal case, use source version of gitweb
 +              SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.perl"
 +      fi
 +      export SCRIPT_NAME
  }
  
  gitweb_run () {
        GATEWAY_INTERFACE='CGI/1.1'
        HTTP_ACCEPT='*/*'
        REQUEST_METHOD='GET'
 -      SCRIPT_NAME="$TEST_DIRECTORY/../gitweb/gitweb.perl"
        QUERY_STRING=""$1""
        PATH_INFO=""$2""
        export GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \
 -              SCRIPT_NAME QUERY_STRING PATH_INFO
 +              QUERY_STRING PATH_INFO
  
        GITWEB_CONFIG=$(pwd)/gitweb_config.perl
        export GITWEB_CONFIG
@@@ -97,9 -80,9 +97,9 @@@ if ! test_have_prereq PERL; the
        test_done
  fi
  
- perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
+ perl -MEncode -e '$e="";decode_utf8($e, Encode::FB_CROAK)' >/dev/null 2>&1 || {
 -    skip_all='skipping gitweb tests, perl version is too old'
 -    test_done
 +      skip_all='skipping gitweb tests, perl version is too old'
 +      test_done
  }
  
  gitweb_init