Re: [RFC] Support TEST_GIT_PATH variable for the path for the git to test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 26 Feb 2008, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@xxxxxxxxxxxx> writes:
> 
> >> I did not mean to imply I was presenting the whole solution; I
> >> was trying to hint at a different direction which may or may not
> >> work.  I did not look at what test_create_repo() actually did
> >> when I wrote the message, but you are right.  It too needs to
> >> be made conditional, and when trying an installed version, it
> >> should not do the "template" dance but let the installed "git init"
> >> figure it out.
> >
> > Does it need to be conditional, or is simply "git init" right (where we've 
> > already set environment variables for the local stuff if applicable)?
> 
> I suspect "uninstalled" cases (both "here" and "elsewhere")
> needs to do the template magic, while "installed" case should be
> just "git init".

Ah, but that doesn't have to be here, since we can (and, AFAICT do) use 
the GIT_TEMPLATE_DIR environment variable, and can set it as appropriate 
in the setup code.

> >> > There's additionally the problem that things which are built for testing 
> >> > in the git directory won't be installed anywhere.
> >> 
> >> To test without installing, in order to make them call out their
> >> siblings, I have this piece that I source to a new shell:
> >> 
> >>         GIT_EXEC_PATH=`pwd`
> >>         PATH=`pwd`:/usr/bin:/bin
> >>         GITPERLLIB=`pwd`/perl/blib/lib
> >>         export GIT_EXEC_PATH PATH GITPERLLIB
> >
> > Might be nice to have a "sgitpath" (on the model of sg or su) in t/, since 
> > this is handy in general.
> 
> I have them in ./+denv and after building if I want to see it
> work in real repo elsewhere I do:
> 
> 	: gitster; sh
>         $ . ./+denv
>         $ cd ../elsewhere.git
>         $ do the real workload trial
>         $ ^D

I was thinking it would be handy to have around t/ in case you want to go 
step-by-step through a failing test, using the git the test would use. For 
that purpose, it would also be handy to pick up the environment variables 
I'm introducing in this thread, I guess.

> > You understood correctly the first time; I was unclear the second time. 
> > The problem here is that, in order to run tests, we call 
> > "test-absolute-path", "test-genrandom", etc., and we can't use these from 
> > the user's $PATH because, being only for testing, they don't get installed 
> > there. We need to get git-remote (for example) from $PATH, but 
> > test-genrandom from $(pwd)/.. in order to make the tests run.
> 
> Ok, so even "installed" case need to rely on "test-blah" we build.

Right. Would it be okay to build those into t/helpers/* or something, 
instead of into the project root, so that they're just naturally separate 
from the actual program?

	-Daniel
*This .sig left intentionally blank*
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux