Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/lib-gitweb.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / lib-gitweb.sh` 128 lines ยท 3403 bytes Raw Blame History 1 # Initialization and helpers for Gitweb tests, which source this 2 # shell library instead of test-lib.sh. 3 # 4 # Copyright (c) 2007 Jakub Narebski 5 # 6 7 gitweb_init () { 8 safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')" 9 cat >gitweb_config.perl <.git/description <gitweb.output 2>gitweb.log && 76 perl -w -e ' 77 open O, ">gitweb.headers"; 78 while (<>) { 79 print O; 80 last if (/^\r$/ || /^$/); 81 } 82 open O, ">gitweb.body"; 83 while (<>) { 84 print O; 85 } 86 close O; 87 ' gitweb.output && 88 if grep '^[[]' gitweb.log >/dev/null 2>&1; then 89 test_debug 'cat gitweb.log >&2' && 90 false 91 else 92 true 93 fi 94 95 # gitweb.log is left for debugging 96 # gitweb.output is used to parse HTTP output 97 # gitweb.headers contains only HTTP headers 98 # gitweb.body contains body of message, without headers 99 } 100 101 . ./test-lib.sh 102 103 if ! test_have_prereq PERL; then 104 skip_all='skipping gitweb tests, perl not available' 105 test_done 106 fi 107 108 if ! test_have_prereq GITWEB; then 109 skip_all='skipping gitweb tests, gitweb not available' 110 test_done 111 fi 112 113 perl -MEncode -e '$e="";decode_utf8($e, Encode::FB_CROAK)' >/dev/null 2>&1 || { 114 skip_all='skipping gitweb tests, perl version is too old' 115 test_done 116 } 117 118 perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || { 119 skip_all='skipping gitweb tests, CGI & CGI::Util & CGI::Carp modules not available' 120 test_done 121 } 122 123 perl -mTime::HiRes -e 0 >/dev/null 2>&1 || { 124 skip_all='skipping gitweb tests, Time::HiRes module not available' 125 test_done 126 } 127 128 gitweb_init