From: Thomas Gummerer <t.gummerer@gmail.com>
To: git@vger.kernel.org
Cc: Thomas Gummerer <t.gummerer@gmail.com>,
Junio C Hamano <gitster@pobox.com>,
Jonathan Nieder <jrnieder@gmail.com>
Subject: [PATCH 2/3] test-lib: allow setting the index format version
Date: Sat, 15 Feb 2014 20:23:14 +0100 [thread overview]
Message-ID: <1392492197-7724-3-git-send-email-t.gummerer@gmail.com> (raw)
In-Reply-To: <1392492197-7724-1-git-send-email-t.gummerer@gmail.com>
Allow adding a TEST_GIT_INDEX_VERSION variable to config.mak to set the
index version with which the test suite should be run.
If it isn't set, the default version given in the source code is
used (currently version 3).
To avoid breakages with index versions other than [23], also set the
index version under which t2104 is run to 3. This test only tests
functionality specific to version 2 and 3 of the index file and would
fail if the test suite is run with any other version.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
---
Makefile | 7 +++++++
t/t2104-update-index-skip-worktree.sh | 2 ++
t/test-lib-functions.sh | 5 +++++
t/test-lib.sh | 3 +++
4 files changed, 17 insertions(+)
diff --git a/Makefile b/Makefile
index 287e6f8..c98d28f 100644
--- a/Makefile
+++ b/Makefile
@@ -342,6 +342,10 @@ all::
# Define DEFAULT_HELP_FORMAT to "man", "info" or "html"
# (defaults to "man") if you want to have a different default when
# "git help" is called without a parameter specifying the format.
+#
+# Define TEST_GIT_INDEX_FORMAT to 2, 3 or 4 to run the test suite
+# with a different indexfile format. If it isn't set the index file
+# format used is index-v[23].
GIT-VERSION-FILE: FORCE
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -2223,6 +2227,9 @@ endif
ifdef GIT_PERF_MAKE_OPTS
@echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@
endif
+ifdef TEST_GIT_INDEX_VERSION
+ @echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@
+endif
### Detect Python interpreter path changes
ifndef NO_PYTHON
diff --git a/t/t2104-update-index-skip-worktree.sh b/t/t2104-update-index-skip-worktree.sh
index 1d0879b..29c1fb1 100755
--- a/t/t2104-update-index-skip-worktree.sh
+++ b/t/t2104-update-index-skip-worktree.sh
@@ -7,6 +7,8 @@ test_description='skip-worktree bit test'
. ./test-lib.sh
+test_set_index_version 3
+
cat >expect.full <<EOF
H 1
H 2
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index aeae3ca..0bf1e63 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -32,6 +32,11 @@ test_set_editor () {
export EDITOR
}
+test_set_index_version () {
+ GIT_INDEX_VERSION="$1"
+ export GIT_INDEX_VERSION
+}
+
test_decode_color () {
awk '
function name(n) {
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 1cf78d5..e6cf5b0 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -108,6 +108,9 @@ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
export EDITOR
+GIT_INDEX_VERSION="$TEST_GIT_INDEX_VERSION"
+export GIT_INDEX_VERSION
+
# Add libc MALLOC and MALLOC_PERTURB test
# only if we are not executing the test with valgrind
if expr " $GIT_TEST_OPTS " : ".* --valgrind " >/dev/null ||
--
1.8.5.2.300.ge613be6.dirty
next prev parent reply other threads:[~2014-02-15 19:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-15 19:23 [PATCH 0/3] Wider exposure for index-v4 Thomas Gummerer
2014-02-15 19:23 ` [PATCH 1/3] introduce GIT_INDEX_VERSION environment variable Thomas Gummerer
2014-02-19 0:31 ` Junio C Hamano
2014-02-21 22:02 ` Thomas Gummerer
2014-02-15 19:23 ` Thomas Gummerer [this message]
2014-02-19 0:31 ` [PATCH 2/3] test-lib: allow setting the index format version Junio C Hamano
2014-02-15 19:23 ` [PATCH 3/3] read-cache: add index.version config variable Thomas Gummerer
2014-02-16 2:10 ` Eric Sunshine
2014-02-16 1:16 ` [PATCH 0/3] Wider exposure for index-v4 Duy Nguyen
2014-02-16 10:37 ` Thomas Gummerer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1392492197-7724-3-git-send-email-t.gummerer@gmail.com \
--to=t.gummerer@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.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.
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 NNTP newsgroup(s).