git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH av/i18n 1/2] tests: Symlink share and po into valgrind wrapper directory
@ 2010-07-25  9:50 Thomas Rast
  2010-07-25  9:50 ` [PATCH av/i18n 2/2] Make git-sh-i18n executable Thomas Rast
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Rast @ 2010-07-25  9:50 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

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(-)

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH av/i18n 2/2] Make git-sh-i18n executable
  2010-07-25  9:50 [PATCH av/i18n 1/2] tests: Symlink share and po into valgrind wrapper directory Thomas Rast
@ 2010-07-25  9:50 ` Thomas Rast
  2010-07-25 10:19   ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Rast @ 2010-07-25  9:50 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

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
-- 
1.7.2.289.g93c76

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH av/i18n 2/2] Make git-sh-i18n executable
  2010-07-25  9:50 ` [PATCH av/i18n 2/2] Make git-sh-i18n executable Thomas Rast
@ 2010-07-25 10:19   ` Ævar Arnfjörð Bjarmason
  2010-07-25 13:15     ` Thomas Rast
  0 siblings, 1 reply; 5+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-07-25 10:19 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Junio C Hamano

On Sun, Jul 25, 2010 at 09:50, Thomas Rast <trast@student.ethz.ch> wrote:
> 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>> ?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH av/i18n 2/2] Make git-sh-i18n executable
  2010-07-25 10:19   ` Ævar Arnfjörð Bjarmason
@ 2010-07-25 13:15     ` Thomas Rast
  2010-07-25 14:55       ` [PATCH ab/i18n v2] tests: locate i18n lib&data correctly under --valgrind Thomas Rast
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Rast @ 2010-07-25 13:15 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Ævar Arnfjörð Bjarmason wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH ab/i18n v2] tests: locate i18n lib&data correctly under --valgrind
  2010-07-25 13:15     ` Thomas Rast
@ 2010-07-25 14:55       ` Thomas Rast
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Rast @ 2010-07-25 14:55 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

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(-)

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-25 14:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-25  9:50 [PATCH av/i18n 1/2] tests: Symlink share and po into valgrind wrapper directory Thomas Rast
2010-07-25  9:50 ` [PATCH av/i18n 2/2] Make git-sh-i18n executable Thomas Rast
2010-07-25 10:19   ` Ævar Arnfjörð Bjarmason
2010-07-25 13:15     ` Thomas Rast
2010-07-25 14:55       ` [PATCH ab/i18n v2] tests: locate i18n lib&data correctly under --valgrind Thomas Rast

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).