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

[PATCH] tests: use $TEST_DIRECTORY to refer to the t/ directory

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 8, 2008, 09:31 UTC
Message-ID
<7vod43etuw.fsf_-_@gitster.siamese.dyndns.org>
In-Reply-To
<7vprojgbbu.fsf@gitster.siamese.dyndns.org>

I'll push this out as 'test-deeper' branch to repo.or.cz (alt-git.git) because the test suite has unprintable bytes that are inappropriate for e-mail transmission.

-- >8 -- Many test scripts assumed that they will start in a 'trash' subdirectory that is a single level down from the t/ directory, and referred to their test vector files by asking for files like "../t9999/expect". This will break if we move the 'trash' subdirectory elsewhere.

To solve this, we earlier introduced "$TEST_DIRECTORY" so that they can refer to t/ directory reliably. This finally makes all the tests use it to refer to the outside environment.

With this patch, and a one-liner not included here (because it would contradict with what Dscho really wants to do):

| diff --git a/t/test-lib.sh b/t/test-lib.sh
| index 70ea7e0..60e69e4 100644
| --- a/t/test-lib.sh
| +++ b/t/test-lib.sh
| @@ -485,7 +485,7 @@ fi
|  . ../GIT-BUILD-OPTIONS
|
|  # Test repository
| -test="trash directory"
| +test="trash directory/another level/yet another"
|  rm -fr "$test" || {
|         trap - exit
|         echo >&5 "FATAL: Cannot prepare test area"

all the tests still pass, but we would want extra sets of eyeballs on this type of change to really make sure.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t0022-crlf-rename.sh                   |    4 ++--
 t/t1000-read-tree-m-3way.sh              |    2 +-
 t/t3900-i18n-commit.sh                   |   18 +++++++++---------
 t/t3901-i18n-patch.sh                    |   28 ++++++++++++++--------------
 t/t4000-diff-format.sh                   |    2 +-
 t/t4001-diff-rename.sh                   |    2 +-
 t/t4002-diff-basic.sh                    |    2 +-
 t/t4003-diff-rename-1.sh                 |    6 +++---
 t/t4004-diff-rename-symlink.sh           |    2 +-
 t/t4005-diff-rename-2.sh                 |    6 +++---
 t/t4007-rename-3.sh                      |    4 ++--
 t/t4008-diff-break-rewrite.sh            |    6 +++---
 t/t4009-diff-rename-4.sh                 |    6 +++---
 t/t4010-diff-pathspec.sh                 |    2 +-
 t/t4011-diff-symlink.sh                  |    2 +-
 t/t4012-diff-binary.sh                   |    2 +-
 t/t4013-diff-various.sh                  |    2 +-
 t/t4015-diff-whitespace.sh               |    2 +-
 t/t4020-diff-external.sh                 |    2 +-
 t/t4022-diff-rewrite.sh                  |    4 ++--
 t/t4023-diff-rename-typechange.sh        |   14 +++++++-------
 t/t4027-diff-submodule.sh                |    2 +-
 t/t4100-apply-stat.sh                    |    4 ++--
 t/t4101-apply-nonl.sh                    |    2 +-
 t/t5100-mailinfo.sh                      |   18 +++++++++---------
 t/t5515-fetch-merge-logic.sh             |    4 ++--
 t/t5540-http-push.sh                     |    2 +-
 t/t6002-rev-list-bisect.sh               |    2 +-
 t/t6003-rev-list-topo-order.sh           |    2 +-
 t/t6023-merge-file.sh                    |    2 +-
 t/t6027-merge-binary.sh                  |    2 +-
 t/t6101-rev-parse-parents.sh             |    2 +-
 t/t6200-fmt-merge-msg.sh                 |    4 ++--
 t/t7001-mv.sh                            |    4 ++--
 t/t7004-tag.sh                           |    2 +-
 t/t7101-reset.sh                         |   10 +++++-----
 t/t7500-commit.sh                        |   16 ++++++++--------
 t/t8001-annotate.sh                      |    2 +-
 t/t8002-blame.sh                         |    2 +-
 t/t9110-git-svn-use-svm-props.sh         |    2 +-
 t/t9111-git-svn-use-svnsync-props.sh     |    2 +-
 t/t9115-git-svn-dcommit-funky-renames.sh |    2 +-
 t/t9121-git-svn-fetch-renamed-dir.sh     |    2 +-
 t/t9200-git-cvsexportcommit.sh           |   14 +++++++-------
 t/t9300-fast-import.sh                   |    2 +-
 t/t9301-fast-export.sh                   |    2 +-
 t/t9500-gitweb-standalone-no-errors.sh   |   16 ++++++++--------
 t/t9700-perl-git.sh                      |    2 +-
 t/t9700/test.pl                          |    3 ---
 t/test-lib.sh                            |    2 +-
 50 files changed, 123 insertions(+), 126 deletions(-)
Previous: Junio C HamanoNext: Johannes Schindelin
Message 10 of 26 in “Enable parallelized tests”
  1. 0/3 Enable parallelized testsJohannes Schindelin, Aug 8, 2008
  2. 1/3 t9700: remove useless checkJohannes Schindelin, Aug 8, 2008
  3. 2/3 tests: Clarify dependencies between tests, 'aggregate-results' and 'clean'Johannes Schindelin, Aug 8, 2008
  4. 3/3 Enable parallel testsJohannes Schindelin, Aug 8, 2008
  5. Junio C HamanoAug 8, 2008
  6. Johannes SchindelinAug 8, 2008
  7. Junio C HamanoAug 8, 2008
  8. René ScharfeAug 8, 2008
  9. Junio C HamanoAug 8, 2008
  10. tests: use $TEST_DIRECTORY to refer to the t/ directoryJunio C Hamano, Aug 8, 2008
  11. Johannes SchindelinAug 8, 2008
  12. Junio C HamanoAug 8, 2008
  13. Stephan BeyerAug 8, 2008
  14. Olivier MarinAug 9, 2008
  15. Junio C HamanoAug 9, 2008
  16. Junio C HamanoAug 10, 2008
  17. Johannes SchindelinAug 8, 2008
  18. 3/3 Enable parallel testsJohannes Schindelin, Aug 8, 2008
  19. Stephan BeyerAug 8, 2008
  20. Johannes SchindelinAug 8, 2008
  21. SZEDER GáborAug 8, 2008
  22. Stephan BeyerAug 8, 2008
  23. Johannes SchindelinAug 8, 2008
  24. Stephan BeyerAug 8, 2008
  25. Johannes SchindelinAug 8, 2008
  26. Stephan BeyerAug 8, 2008

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.