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

[PATCH 1/5] Export more test-related variables when running external tests

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 24, 2010, 13:50 UTC
Message-ID
<20100424134640.30511.37449.stgit@localhost.localdomain>
In-Reply-To
<20100424132255.30511.98829.stgit@localhost.localdomain>

Add exporting TEST_DIRECTORY and TRASH_DIRECTORY to test_external, for external tests to be able to find test script (and git sources), and to find trash directory (usually with test repository in it).

Add also exporting GIT_TEST_LONG, so that external test can skip time-intensive tests unless test is invoked with `--long' option.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Currently there is no test that requires those variables; git test
suite uses test_external* only in t9700-perl-git.sh.  It would be
needed for tests of caching for gitweb.
Nevertheless I think it is a good change to have...
 t/test-lib.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 t/test-lib.sh
diff --git a/t/test-lib.sh b/t/test-lib.sh
old mode 100644
new mode 100755
index c582964..6187328
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -459,6 +459,9 @@ test_external () {
 		# Announce the script to reduce confusion about the
 		# test output that follows.
 		say_color "" " run $test_count: $descr ($*)"
+		# Export TEST_DIRECTORY, TRASH_DIRECTORY and GIT_TEST_LONG
+		# to be able to use them in script
+		export TEST_DIRECTORY TRASH_DIRECTORY GIT_TEST_LONG
 		# Run command; redirect its stderr to &4 as in
 		# test_run_, but keep its stdout on our stdout even in
 		# non-verbose mode.
Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 10 in “gitweb: Miscellaneous improvements, in preparation for caching support”
  1. 0/5 gitweb: Miscellaneous improvements, in preparation for caching supportJakub Narebski, Apr 24, 2010
  2. 1/5 Export more test-related variables when running external testsJakub Narebski, Apr 24, 2010
  3. Jakub NarebskiApr 25, 2010
  4. 2/5 gitweb: href(..., -path_info => 0|1)Jakub Narebski, Apr 24, 2010
  5. 3/5 gitweb: Use nonlocal jump instead of 'exit' in die_errorJakub Narebski, Apr 24, 2010
  6. Jakub NarebskiMay 4, 2010
  7. 4/5 gitweb: Add custom error handler using die_errorJakub Narebski, Apr 24, 2010
  8. 5/5 gitweb: Move generating page title to separate subroutineJakub Narebski, Apr 24, 2010
  9. Petr BaudisApr 25, 2010
  10. Jakub NarebskiApr 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.