Skip to content

Commit

Permalink
Merge branch 'jk/interop-test-build-options' into next
Browse files Browse the repository at this point in the history
The support to customize build options to adjust for older versions
and/or older systems for the interop tests has been improved.

* jk/interop-test-build-options:
  t/interop: allow per-version make options
  • Loading branch information
gitster committed Sep 13, 2024
2 parents 07f5e48 + 22ef5f0 commit 0ab66e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions t/interop/README
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,10 @@ You can then use test_expect_success as usual, with a few differences:
should create one with the appropriate version of git.

At the end of the script, call test_done as usual.

Some older versions may need a few build knobs tweaked (e.g., ancient
versions of Git no longer build with modern OpenSSL). Your script can
set MAKE_OPTS_A and MAKE_OPTS_B, which will be passed alongside
GIT_INTEROP_MAKE_OPTS. Users can override them per-script by setting
GIT_INTEROP_MAKE_OPTS_{A,B} in the environment, just like they can set
GIT_TEST_VERSION_{A,B}.
1 change: 1 addition & 0 deletions t/interop/i5500-git-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

VERSION_A=.
VERSION_B=v1.0.0
MAKE_OPTS_B="NO_OPENSSL=TooOld"

: ${LIB_GIT_DAEMON_PORT:=5500}
LIB_GIT_DAEMON_COMMAND='git.a daemon'
Expand Down
8 changes: 5 additions & 3 deletions t/interop/interop-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ build_version () {

(
cd "$dir" &&
make $GIT_INTEROP_MAKE_OPTS >&2 &&
make $2 $GIT_INTEROP_MAKE_OPTS >&2 &&
touch .built
) || return 1

Expand Down Expand Up @@ -76,9 +76,11 @@ generate_wrappers () {

VERSION_A=${GIT_TEST_VERSION_A:-$VERSION_A}
VERSION_B=${GIT_TEST_VERSION_B:-$VERSION_B}
MAKE_OPTS_A=${GIT_INTEROP_MAKE_OPTS_A:-$MAKE_OPTS_A}
MAKE_OPTS_B=${GIT_INTEROP_MAKE_OPTS_B:-$MAKE_OPTS_B}

if ! DIR_A=$(build_version "$VERSION_A") ||
! DIR_B=$(build_version "$VERSION_B")
if ! DIR_A=$(build_version "$VERSION_A" "$MAKE_OPTS_A") ||
! DIR_B=$(build_version "$VERSION_B" "$MAKE_OPTS_B")
then
echo >&2 "fatal: unable to build git versions"
exit 1
Expand Down

0 comments on commit 0ab66e7

Please sign in to comment.