From: Tomi Ollila <tomi.ollila@iki.fi>
To: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>,
notmuch@notmuchmail.org
Cc: Ethan Glasser-Camp <ethan@betacantrips.com>
Subject: Re: [PATCH] test: handle filenames that have directories in them
Date: Thu, 18 Oct 2012 08:43:21 +0300 [thread overview]
Message-ID: <m2bog01gjq.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <1350074609-21769-1-git-send-email-ethan@betacantrips.com>
On Fri, Oct 12 2012, Ethan Glasser-Camp <ethan.glasser.camp@gmail.com> wrote:
> Since $TEST_DIRECTORY is an absolute path, any filenames generated
> with it will be complete paths. Only use the basename to generate
> suffixes for filenames.
>
> Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
> ---
> Discovered this while reviewing the patch queue. test/emacs generates
> filenames using $TEST_DIRECTORY, which is generated using pwd(1). Test
> failures then cause failures in the test harness.
LGTM.
Removing needs-review (for this trivial change) as this helps the
good review work Ethan is doing :D
Tomi
Ps: some shell "trivia ;)" basename=`basename "$file"` works for variable
assignment; when giving as argument to command that needs one more quotes:
e.g. wc "`basename "$file"`"
fun?!
>
> test/test-lib.sh | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index 7448b45..8de5e32 100644
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -498,16 +498,18 @@ test_expect_equal_file ()
> error "bug in the test script: not 2 or 3 parameters to test_expect_equal"
>
> file1="$1"
> + basename1=`basename "$file1"`
> file2="$2"
> + basename2=`basename "$file2"`
> if ! test_skip "$test_subtest_name"
> then
> if diff -q "$file1" "$file2" >/dev/null ; then
> test_ok_ "$test_subtest_name"
> else
> testname=$this_test.$test_count
> - cp "$file1" "$testname.$file1"
> - cp "$file2" "$testname.$file2"
> - test_failure_ "$test_subtest_name" "$(diff -u "$testname.$file1" "$testname.$file2")"
> + cp "$file1" "$testname.$basename1"
> + cp "$file2" "$testname.$basename2"
> + test_failure_ "$test_subtest_name" "$(diff -u "$testname.$basename1" "$testname.$basename2")"
> fi
> fi
> }
> --
> 1.7.9.5
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
next prev parent reply other threads:[~2012-10-18 5:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-12 20:43 [PATCH] test: handle filenames that have directories in them Ethan Glasser-Camp
2012-10-18 5:43 ` Tomi Ollila [this message]
2012-10-18 12:02 ` David Bremner
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: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2bog01gjq.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=ethan.glasser.camp@gmail.com \
--cc=ethan@betacantrips.com \
--cc=notmuch@notmuchmail.org \
/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://yhetil.org/notmuch.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).