git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 0/5] tests: various improvements to the GIT_TEST_INSTALLED feature
Date: Wed, 14 Nov 2018 08:32:02 -0800 (PST)	[thread overview]
Message-ID: <pull.73.v2.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.73.git.gitgitgadget@gmail.com>

By setting the GIT_TEST_INSTALLED variable to the path of an installed Git
executable, it is possible to run the test suite also on a specific
installed version (as opposed to a version built from scratch).

The only thing this needs that is unlikely to be installed is the test
helper(s).

However, there have been a few rough edges around that, identified in my
(still ongoing) work to support building Git in Visual Studio (where we do
not want to run GNU Make, and where we have no canonical way to create, say,
hard-linked copies of the built-in commands, and other work to let Git for
Windows play better with BusyBox.

Triggered by a comment of AEvar
[https://public-inbox.org/git/20181102223743.4331-1-avarab@gmail.com/], I
hereby contribute these assorted fixes for the GIT_TEST_INSTALLED feature.

Changes since v1:

 * Now we verify in test-lib.sh also in the GIT_TEST_INSTALLED case whether
   the Git executable is working (thanks, Peff!).
 * The commit message of 5/5 was touched up.

Johannes Schindelin (5):
  tests: fix GIT_TEST_INSTALLED's PATH to include t/helper/
  tests: respect GIT_TEST_INSTALLED when initializing repositories
  t/lib-gettext: test installed git-sh-i18n if GIT_TEST_INSTALLED is set
  tests: do not require Git to be built when testing an installed Git
  tests: explicitly use `git.exe` on Windows

 Makefile                |  1 +
 t/lib-gettext.sh        |  7 ++++++-
 t/test-lib-functions.sh |  3 ++-
 t/test-lib.sh           | 22 ++++++++++++++++------
 4 files changed, 25 insertions(+), 8 deletions(-)


base-commit: d166e6afe5f257217836ef24a73764eba390c58d
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-73%2Fdscho%2Ftest-git-installed-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-73/dscho/test-git-installed-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/73

Range-diff vs v1:

 1:  2b04f9f086 = 1:  3b68e0fe8a tests: fix GIT_TEST_INSTALLED's PATH to include t/helper/
 2:  948b3dc146 = 2:  80d50d5932 tests: respect GIT_TEST_INSTALLED when initializing repositories
 3:  eddea552e4 = 3:  49e408677a t/lib-gettext: test installed git-sh-i18n if GIT_TEST_INSTALLED is set
 4:  316e215e54 < -:  ---------- tests: do not require Git to be built when testing an installed Git
 -:  ---------- > 4:  b801dc8027 tests: do not require Git to be built when testing an installed Git
 5:  cd314e1384 ! 5:  fbdb659de6 tests: explicitly use `git.exe` on Windows
     @@ -2,6 +2,17 @@
      
          tests: explicitly use `git.exe` on Windows
      
     +    On Windows, when we refer to `/an/absolute/path/to/git`, it magically
     +    resolves `git.exe` at that location. Except if something of the name
     +    `git` exists next to that `git.exe`. So if we call `$BUILD_DIR/git`, it
     +    will find `$BUILD_DIR/git.exe` *only* if there is not, say, a directory
     +    called `$BUILD_DIR/git`.
     +
     +    Such a directory, however, exists in Git for Windows when building with
     +    Visual Studio (our Visual Studio project generator defaults to putting
     +    the build files into a directory whose name is the base name of the
     +    corresponding `.exe`).
     +
          In the bin-wrappers/* scripts, we already take pains to use `git.exe`
          rather than `git`, as this could pick up the wrong thing on Windows
          (i.e. if there exists a `git` file or directory in the build directory).
     @@ -68,11 +79,12 @@
      +
       ################################################################
       # It appears that people try to run tests without building...
     --test -n "$GIT_TEST_INSTALLED" || "$GIT_BUILD_DIR/git" >/dev/null ||
     -+test -n "$GIT_TEST_INSTALLED" || "$GIT_BUILD_DIR/git$X" >/dev/null ||
     +-"${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git" >/dev/null
     ++"${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git$X" >/dev/null
       if test $? != 1
       then
     - 	echo >&2 'error: you do not seem to have built git yet.'
     + 	if test -n "$GIT_TEST_INSTALLED"
     +@@
       	exit 1
       fi
       

-- 
gitgitgadget

  parent reply	other threads:[~2018-11-14 16:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 13:48 [PATCH 0/5] tests: various improvements to the GIT_TEST_INSTALLED feature Johannes Schindelin via GitGitGadget
2018-11-12 13:48 ` [PATCH 1/5] tests: fix GIT_TEST_INSTALLED's PATH to include t/helper/ Johannes Schindelin via GitGitGadget
2018-11-14  4:53   ` Junio C Hamano
2018-11-12 13:48 ` [PATCH 2/5] tests: respect GIT_TEST_INSTALLED when initializing repositories Johannes Schindelin via GitGitGadget
2018-11-14  4:55   ` Junio C Hamano
2018-11-14 13:16     ` Johannes Schindelin
2018-11-14 14:59       ` Junio C Hamano
2018-11-14 21:38       ` Jeff King
2018-11-15 12:29         ` Johannes Schindelin
2018-11-15 12:41           ` Jeff King
2018-11-12 13:48 ` [PATCH 3/5] t/lib-gettext: test installed git-sh-i18n if GIT_TEST_INSTALLED is set Johannes Schindelin via GitGitGadget
2018-11-14  4:56   ` Junio C Hamano
2018-11-12 13:48 ` [PATCH 4/5] tests: do not require Git to be built when testing an installed Git Johannes Schindelin via GitGitGadget
2018-11-14  5:01   ` Junio C Hamano
2018-11-14 13:20     ` Johannes Schindelin
2018-11-14 12:52   ` Jeff King
2018-11-14 13:41     ` Johannes Schindelin
2018-11-12 13:48 ` [PATCH 5/5] tests: explicitly use `git.exe` on Windows Johannes Schindelin via GitGitGadget
2018-11-14  5:14   ` Junio C Hamano
2018-11-14 13:24     ` Johannes Schindelin
2018-11-14 14:47       ` Junio C Hamano
2018-11-14 16:32 ` Johannes Schindelin via GitGitGadget [this message]
2018-11-14 16:32   ` [PATCH v2 1/5] tests: fix GIT_TEST_INSTALLED's PATH to include t/helper/ Johannes Schindelin via GitGitGadget
2018-11-14 16:32   ` [PATCH v2 2/5] tests: respect GIT_TEST_INSTALLED when initializing repositories Johannes Schindelin via GitGitGadget
2018-11-14 16:32   ` [PATCH v2 3/5] t/lib-gettext: test installed git-sh-i18n if GIT_TEST_INSTALLED is set Johannes Schindelin via GitGitGadget
2018-11-14 16:32   ` [PATCH v2 4/5] tests: do not require Git to be built when testing an installed Git Johannes Schindelin via GitGitGadget
2018-11-14 16:32   ` [PATCH v2 5/5] tests: explicitly use `git.exe` on Windows Johannes Schindelin via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.73.v2.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).