From: "David A. Greene" <dag@cray•com>
To: Junio C Hamano <gitster@pobox•com>
Cc: <git@vger•kernel.org>, "David A. Greene" <dag@cray•com>,
Thomas Rast <trast@inf•ethz.ch>
Subject: Re: [PATCH 2/2] Support Out-Of-Tree Valgrind Tests
Date: Tue, 6 Mar 2012 17:00:19 -0600 [thread overview]
Message-ID: <87mx7te3ng.fsf@smith.obbligato.org> (raw)
In-Reply-To: <7v7gyxqrty.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Tue, 6 Mar 2012 14:37:13 -0800")
Junio C Hamano <gitster@pobox•com> writes:
> that says "As a side benefit this change also makes it easy for us
> to move the t/*.sh tests into subdirectories if we ever want to do
> that."
>
> This expects that an out-of-tree test script is expected to set
> TEST_DIRECTORY before dot-sourcing test-lib.sh, e.g.
>
> #!/bin/sh
> TEST_DIRECTORY=/srv/project/git/git.git/t
> test_description='an out-of-tree test'
> . "$TEST_DIRECTORY/test-lib.sh"
Hmm...I think I missed this part when I originally tried this. I
originally tried to set TEST_DIRECTORY in the environment and I
misunderstood its role.
> which in turn lets the test framework to learn GIT_BUILD_DIR. From
> there, 'git' will be found in GIT_BUILD_DIR/bin-wrappers and the
> valgrind variants are found in a similar way.
Ok, I see. So TEST_DIRECTORY is supposed to point to the "official"
location of git's tests and testing support files. That wasn't clear to
me.
> One thing that is potentially missing is a way for such an out-of-tree
> test scripts to ship with supporting material in a separate file,
> relative to the test script. The in-tree t/t4013-diff-various.sh
> has its test vectors kept in t/t4013/ directory and finds them by
> doing
>
> expect="$TEST_DIRECTORY/t4013/diff.$test"
Right. I did not run into this issue but I can see how others might.
> This is because the working directory after test-lib comes back to
> us may not be "trash" directory under TEST_DIRECTORY, and ../t4013/
> is not the right way to find it. If an out-of-tree test t9999 wants
> to do something similar, it needs to do something like:
>
> #!/bin/sh
> HERE=$(PWD)
> TEST_DIRECTORY=/srv/project/git/git.git/t
> test_description='an out-of-tree test'
> . "$TEST_DIRECTORY/test-lib.sh"
>
> and find it relative to $HERE, e.g. "$HERE/../t9999/diff.$test"
Ahh...
> Of course, it would be nice to use a name better than $HERE for such
> a purpose ;-)
I think naming is a big issue here. Perhaps TEST_DIRECTORY needs a
better name, something like GIT_TEST_SUPPORT or such?
So before you apply my patches let me try to restructure the git-subtree
tests with this newly provided insight and see if I can get it to work.
Thanks, Junio!
-Dave
next prev parent reply other threads:[~2012-03-06 23:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-04 23:23 [PATCH 1/2] Allow Overriding GIT_BUILD_DIR greened
2012-03-04 23:23 ` [PATCH 2/2] Support Out-Of-Tree Valgrind Tests greened
2012-03-05 7:53 ` Thomas Rast
2012-03-05 18:11 ` David A. Greene
2012-03-06 8:46 ` Thomas Rast
2012-03-06 14:40 ` David A. Greene
2012-03-06 18:49 ` Junio C Hamano
2012-03-06 22:12 ` David A. Greene
2012-03-06 22:21 ` Junio C Hamano
2012-03-06 22:37 ` Junio C Hamano
2012-03-06 23:00 ` David A. Greene [this message]
2012-03-06 23:12 ` Junio C Hamano
2012-03-06 22:54 ` David A. Greene
2012-03-06 18:43 ` Junio C Hamano
2012-03-05 6:33 ` [PATCH 1/2] Allow Overriding GIT_BUILD_DIR Junio C Hamano
2012-03-05 18:10 ` David A. Greene
2012-03-05 20:08 ` Junio C Hamano
2012-03-06 14:21 ` David A. Greene
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mx7te3ng.fsf@smith.obbligato.org \
--to=dag@cray$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=trast@inf$(echo .)ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox