threads / patch / 24507

patch, 2 partstests: Symlink share and po into valgrind wrapper directory

Subject: [PATCH av/i18n 1/2] tests: Symlink share and po into valgrind wrapper directory

## tl;dr

5 messages between Jul 25, 2010 and Jul 25, 2010. Diffs are folded; open one to read it.

replies: 4people: 2as markdown or json

Thomas Rast· Jul 25, 2010, 09:50 UTC · lore

This is required since with --valgrind, the $GIT_EXEC_PATH that is used to determine the proper location of these directories points to .../t/valgrind/bin.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 t/test-lib.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Show changes to t/test-lib.sh +2 −0
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4ae0de8..2f4bb27 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -735,6 +735,8 @@ then
 	do
 		make_valgrind_symlink $file
 	done
+	make_symlink "$TEST_DIRECTORY/../po" "$GIT_VALGRIND"/bin/po
+	make_symlink "$TEST_DIRECTORY/../share" "$GIT_VALGRIND"/bin/share
 	OLDIFS=$IFS
 	IFS=:
 	for path in $PATH
-- 
1.7.2.289.g93c76
Thomas Rast· Jul 25, 2010, 09:50 UTC · re: Thomas Rast · lore

[PATCH av/i18n 2/2] Make git-sh-i18n executable

git-sh-i18n was not picked up by the valgrind wrapper code because that tests for the executable bit. Since there does not seem to be a particular reason why it needs to be non-executable, and this is the path of least special-casing to fix --valgrind testing, just make it executable.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 0 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 git-sh-i18n.sh
Show changes to git-sh-i18n.sh +0 −0
diff --git a/git-sh-i18n.sh b/git-sh-i18n.sh
old mode 100644
new mode 100755
-- 
1.7.2.289.g93c76
Ævar Arnfjörð Bjarmason· Jul 25, 2010, 10:19 UTC · re: Thomas Rast · lore

Re: [PATCH av/i18n 2/2] Make git-sh-i18n executable

On Sun, Jul 25, 2010 at 09:50, Thomas Rast <trast@student.ethz.ch> wrote:
Show 15 quoted lines
> git-sh-i18n was not picked up by the valgrind wrapper code because
> that tests for the executable bit.  Since there does not seem to be a
> particular reason why it needs to be non-executable, and this is the
> path of least special-casing to fix --valgrind testing, just make it
> executable.
>
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
> ---
>  0 files changed, 0 insertions(+), 0 deletions(-)
>  mode change 100644 => 100755 git-sh-i18n.sh
>
> diff --git a/git-sh-i18n.sh b/git-sh-i18n.sh
> old mode 100644
> new mode 100755
> --

Why is it including git-sh-i18n.sh? It should only be using the generated SCRIPT_LIB git-sh-i18n file.

On my system the executable bit of git-sh-i18n.sh has no effect on the generated git-sh-i18n file:

    $ rm git-sh-i18n; chmod +x git-sh-i18n.sh ; make ; ls -l git-sh-i18n*
        GEN git-sh-i18n
        SUBDIR git-gui
        SUBDIR gitk-git
    make[1]: Nothing to be done for `all'.
        SUBDIR perl
        SUBDIR git_remote_helpers
        SUBDIR templates
    -rw-r--r-- 1 avar avar 1965 2010-07-25 10:15 git-sh-i18n
    -rwxr-xr-x 1 avar avar 1955 2010-07-25 10:08 git-sh-i18n.sh

And this still leaves git-sh-setup without an executable bit, why doesn't that fail under valgrind while git-sh-i18n apparently does? Maybe something to do with it being included as <<. "$GIT_EXEC_PATH"/git-sh-i18n>> instead of as <<. git-sh-setup>> ?

Thomas Rast· Jul 25, 2010, 13:15 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: [PATCH av/i18n 2/2] Make git-sh-i18n executable

Ævar Arnfjörð Bjarmason wrote:
Show 5 quoted lines
> Why is it including git-sh-i18n.sh? It should only be using the
> generated SCRIPT_LIB git-sh-i18n file.
> 
> On my system the executable bit of git-sh-i18n.sh has no effect on the
> generated git-sh-i18n file:

Hmph, you're right. I'd have to move it into the SCRIPT_SH category instead of SCRIPT_LIB to affect the executable bit.

Back to the drawing board I guess...
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Thomas Rast· Jul 25, 2010, 14:55 UTC · re: Thomas Rast · lore

[PATCH ab/i18n v2] tests: locate i18n lib&data correctly under --valgrind

The new t020[01] for gettext support did not find git-sh-i18n and the translation data when run under --valgrind: lib-gettext.sh tried to locate them under $GIT_EXEC_PATH, which normally is the git build directory, but is changed by --valgrind to point to the wrappers.

Introduce a new variable $GIT_BUILD_DIR which can be used to locate data that resides under the build directory, and use that instead.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
This approach fixes both problems in one go.
 t/lib-gettext.sh |    6 +++---
 t/test-lib.sh    |    1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
Show changes to 2 files +4 −3

t/lib-gettext.sh, t/test-lib.sh

diff --git a/t/lib-gettext.sh b/t/lib-gettext.sh
index 831ee38..f0cdd3d 100644
--- a/t/lib-gettext.sh
+++ b/t/lib-gettext.sh
@@ -5,11 +5,11 @@
 
 . ./test-lib.sh
 
-GIT_TEXTDOMAINDIR="$GIT_EXEC_PATH/share/locale"
-GIT_PO_PATH="$GIT_EXEC_PATH/po"
+GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/share/locale"
+GIT_PO_PATH="$GIT_BUILD_DIR/po"
 export GIT_TEXTDOMAINDIR GIT_PO_PATH
 
-. "$GIT_EXEC_PATH"/git-sh-i18n
+. "$GIT_BUILD_DIR"/git-sh-i18n
 
 if test_have_prereq GETTEXT
 then
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4ae0de8..08e5438 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -768,6 +768,7 @@ else # normal case, use ../bin-wrappers only unless $with_dashes:
 		PATH="$TEST_DIRECTORY/..:$PATH"
 	fi
 fi
+GIT_BUILD_DIR=$(pwd)/..
 GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
 unset GIT_CONFIG
 GIT_CONFIG_NOSYSTEM=1
-- 
1.7.2.289.g93c76

← back to recent threads