Skip to content

Commit 6b1f9e9

Browse files
pks-tttaylorr
authored andcommitted
t/lib-gitweb: test against the build version of gitweb
When testing gitweb we set up the CGI script as "gitweb.perl", which is the source file of the build target "gitweb.cgi". This file doesn't have a patched shebang and still contains `++REPLACEMENT++` markers, but things generally work because we replace the configuration with our own test configuration. But this only works as long as "$GIT_BUILD_DIR" actually points to the source tree, because "gitweb.cgi" and "gitweb.perl" happen to sit next to each other. This is not the case though once you have out-of-tree builds like with CMake, where the source and built versions live in different directories. Consequently, "$GIT_BUILD_DIR/gitweb/gitweb.perl" won't exist there. While we could ask build systems with out-of-tree builds to instead set up GITWEB_TEST_INSTALLED, which allows us to override the location of the script, it goes against the spirit of this environment variable. We _don't_ want to test against an installed version, we want to use the version we have just built. Fix this by using "gitweb.cgi" instead. This means that you cannot run test scripts without building that file, but in general we do expect developers to build stuff before they test it anyway. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent df383b5 commit 6b1f9e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/lib-gitweb.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ EOF
4848
test -f "$SCRIPT_NAME" ||
4949
error "Cannot find gitweb at $GITWEB_TEST_INSTALLED."
5050
say "# Testing $SCRIPT_NAME"
51-
else # normal case, use source version of gitweb
52-
SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.perl"
51+
else # normal case, use built version of gitweb
52+
SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.cgi"
5353
fi
5454
export SCRIPT_NAME
5555
}

0 commit comments

Comments
 (0)