git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Thomas Rast <trast@student.ethz.ch>
Date
Jul 25, 2010, 14:55 UTC
Message-ID
<06b6dd297e87a92e1c9000f5998e7bc955933235.1280069635.git.trast@student.ethz.ch>
In-Reply-To
<201007251515.08916.trast@student.ethz.ch>

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
Previous: Thomas Rast
Message 5 of 5 in “tests: Symlink share and po into valgrind wrapper directory”
  1. 1/2 tests: Symlink share and po into valgrind wrapper directoryThomas Rast, Jul 25, 2010
  2. 2/2 Make git-sh-i18n executableThomas Rast, Jul 25, 2010
  3. Ævar Arnfjörð BjarmasonJul 25, 2010
  4. Thomas RastJul 25, 2010
  5. tests: locate i18n lib&data correctly under --valgrindThomas Rast, Jul 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.