git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andrei Rybak <rybak.a.v@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jonathan Nieder <jrnieder@gmail.com>
Subject: [PATCH v3] test-lib: drop comment about test_description
Date: Sun, 26 Feb 2023 11:53:03 +0100	[thread overview]
Message-ID: <20230226105303.55033-1-rybak.a.v@gmail.com> (raw)
In-Reply-To: <20230225190526.21780-1-rybak.a.v@gmail.com>

When a comment describing how each test file should start was added in
commit [1], it was the second comment of t/test-lib.sh.  The comment
describes how variable "test_description" is supposed to be assigned at
the top of each test file and how "test-lib.sh" should be used by
sourcing it.  However, even in [1], the comment was ten lines away from
the usage of the variable by test-lib.sh.  Since then, the comment has
drifted away both from the top of the file and from the usage of the
variable.  The comment just sits in the middle of the initialization of
the test library, surrounded by unrelated code, almost one hundred lines
away from the usage of "test_description".

Nobody has noticed this drift during evolution of test-lib.sh, which
suggests that this comment has outlived its usefulness.  The assignment
of "test_description", sourcing of "test-lib.sh" by tests, and the
process of writing tests in general are described in detail in
"t/README".  So drop the obsolete comment.

An alternative solution could be to move the comment either to the top
of the file, or down to the usage of variable "test_description".

[1] e1970ce43a ("[PATCH 1/2] Test framework take two.", 2005-05-13)

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
---

  On 2023-02-25T23:50, Junio C Hamano wrote:
  > Andrei Rybak <rybak.a.v@gmail.com> writes:
  >> An alternative solution is to move the comment down to the usage of
  >> variable "test_description".
  > 
  > Or at the beginning, as the comment is about "how you can use this
  > test-lib.sh test library in your tests".

Here's v3 with updated description of the dropped comment and updated
description of the alternative solution.

  > I have no strong preference.  Just dropping it sounds easier, as a
  > more readable description already exists elsewhere.

Also, at the top of "test-lib.sh", there is a comment pointing to that other
place:

  # Test framework for git.  See t/README for usage.

added in c74c72034f (test: replace shebangs with descriptions in shell
libraries, 2013-11-25).

 t/test-lib.sh | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index d272cca008..62136caee5 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -645,12 +645,6 @@ u200c=$(printf '\342\200\214')
 
 export _x05 _x35 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID OID_REGEX
 
-# Each test should start with something like this, after copyright notices:
-#
-# test_description='Description of this test...
-# This test checks if command xyzzy does the right thing...
-# '
-# . ./test-lib.sh
 test "x$TERM" != "xdumb" && (
 		test -t 1 &&
 		tput bold >/dev/null 2>&1 &&
-- 
2.39.2


      parent reply	other threads:[~2023-02-26 10:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 23:22 [RFC PATCH v1] test-lib: move comment about test_description Andrei Rybak
2023-02-25 19:05 ` [RFC PATCH v2] test-lib: drop " Andrei Rybak
2023-02-25 22:50   ` Junio C Hamano
2023-02-26 10:53   ` Andrei Rybak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230226105303.55033-1-rybak.a.v@gmail.com \
    --to=rybak.a.v@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).