X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft9500-gitweb-standalone-no-errors.sh;h=21cd286bb7abf33c944a8758ce8d702e83ca2022;hb=c7deb8dac1f24498a353327ec9fceb99695582c2;hp=2fc7fdb124583f86d5be622510f29ceca1dd3e09;hpb=a07b10c8f930e88386d3b7424f25190af554275e;p=git.git diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh index 2fc7fdb12..21cd286bb 100755 --- a/t/t9500-gitweb-standalone-no-errors.sh +++ b/t/t9500-gitweb-standalone-no-errors.sh @@ -591,13 +591,21 @@ test_debug 'cat gitweb.log' # ---------------------------------------------------------------------- # gitweb config and repo config -cat >>gitweb_config.perl <>gitweb_config.perl <<\EOF + +# turn on override for each overridable feature +foreach my $key (keys %feature) { + if ($feature{$key}{'sub'}) { + $feature{$key}{'override'} = 1; + } +} EOF +test_expect_success \ + 'config override: projects list (implicit)' \ + 'gitweb_run' +test_debug 'cat gitweb.log' + test_expect_success \ 'config override: tree view, features not overridden in repo config' \ 'gitweb_run "p=.git;a=tree"' @@ -639,4 +647,34 @@ test_expect_success \ gitweb_run "p=.git;a=summary"' test_debug 'cat gitweb.log' +# ---------------------------------------------------------------------- +# syntax highlighting + + +highlight --version >/dev/null 2>&1 +if [ $? -eq 127 ]; then + say "Skipping syntax highlighting test, because 'highlight' was not found" +else + test_set_prereq HIGHLIGHT + cat >>gitweb_config.perl <<-\EOF + our $highlight_bin = "highlight"; + $feature{'highlight'}{'override'} = 1; + EOF +fi + +test_expect_success HIGHLIGHT \ + 'syntax highlighting (no highlight, unknown syntax)' \ + 'git config gitweb.highlight yes && + gitweb_run "p=.git;a=blob;f=file"' +test_debug 'cat gitweb.log' + +test_expect_success HIGHLIGHT \ + 'syntax highlighting (highlighted, shell script)' \ + 'git config gitweb.highlight yes && + echo "#!/usr/bin/sh" > test.sh && + git add test.sh && + git commit -m "Add test.sh" && + gitweb_run "p=.git;a=blob;f=test.sh"' +test_debug 'cat gitweb.log' + test_done