# [PATCH] Ensure test-genrandom availability for t5301/t5302

4 messages from 2007-04-28 to 2007-04-28. Participants: Dana How, Junio C Hamano.
Thread: https://gitlist.dev/t/7890

## Dana How, 2007-04-28 19:46

Subject: [PATCH] Ensure test-genrandom availability for t5301/t5302
Message-ID: <4633A47A.4020508@cswitch.com>
URL: https://gitlist.dev/e/4633A47A.4020508%40cswitch.com

```

Check for this as well as test-chmtime in test-lib.sh

Signed-off-by: Dana L. How <danahow@gmail.com>
---
 t/test-lib.sh |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index f2c6bd3..d7838fc 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -268,11 +268,14 @@ test -d ../templates/blt || {
 	error "You haven't built things yet, have you?"
 }
 
-if ! test -x ../test-chmtime; then
-	echo >&2 'You need to build test-chmtime:'
-	echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
-	exit 1
-fi
+for prog in test-chmtime test-genrandom
+do
+	if ! test -x ../$prog; then
+		echo >&2 "You need to build $prog:"
+		echo >&2 "Run \"make $prog\" in the source (toplevel) directory"
+		exit 1
+	fi
+done
 
 # Test repository
 test=trash
-- 
1.5.2.rc0.71.g4342-dirty

```

## Junio C Hamano, 2007-04-28 22:32

Subject: Re: [PATCH] Ensure test-genrandom availability for t5301/t5302
Message-ID: <7v3b2kjfji.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v3b2kjfji.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <4633A47A.4020508@cswitch.com>

```
Dana How <how@cswitch.com> writes:

> Check for this as well as test-chmtime in test-lib.sh
>
> Signed-off-by: Dana L. How <danahow@gmail.com>
> ---
>  t/test-lib.sh |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index f2c6bd3..d7838fc 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -268,11 +268,14 @@ test -d ../templates/blt || {
>  	error "You haven't built things yet, have you?"
>  }
>  
> -if ! test -x ../test-chmtime; then
> -	echo >&2 'You need to build test-chmtime:'
> -	echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
> -	exit 1
> -fi
> +for prog in test-chmtime test-genrandom
> +do
> +	if ! test -x ../$prog; then
> +		echo >&2 "You need to build $prog:"
> +		echo >&2 "Run \"make $prog\" in the source (toplevel) directory"
> +		exit 1
> +	fi
> +done
>  
>  # Test repository
>  test=trash
> -- 
> 1.5.2.rc0.71.g4342-dirty

As these two are very small programs, why not always build them
upon "make all", like this?

---
 Makefile |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 60c41fd..817f8ef 100644
--- a/Makefile
+++ b/Makefile
@@ -933,13 +933,17 @@ endif
 
 ### Testing rules
 
+TEST_PROGRAMS = test-chmtime$X test-genrandom$X
+
+all:: $(TEST_PROGRAMS)
+
 # GNU make supports exporting all variables by "export" without parameters.
 # However, the environment gets quite big, and some programs have problems
 # with that.
 
 export NO_SVN_TESTS
 
-test: all test-chmtime$X test-genrandom$X
+test: all
 	$(MAKE) -C t/ all
 
 test-date$X: test-date.c date.o ctype.o

```

## Dana How, 2007-04-28 22:36

Subject: Re: [PATCH] Ensure test-genrandom availability for t5301/t5302
Message-ID: <56b7f5510704281536u5b5751a0k504a5ec0f8a36cf7@mail.gmail.com>
URL: https://gitlist.dev/e/56b7f5510704281536u5b5751a0k504a5ec0f8a36cf7%40mail.gmail.com
In-Reply-To: <7v3b2kjfji.fsf@assigned-by-dhcp.cox.net>

```
Either way is fine with me.
I just don't want any one to have the nasty surprise I had --
fortunately I figured it out quickly.

So you will apply your patch?

Thanks,

Dana

On 4/28/07, Junio C Hamano <junkio@cox.net> wrote:
> Dana How <how@cswitch.com> writes:
>
> > Check for this as well as test-chmtime in test-lib.sh
> >
> > Signed-off-by: Dana L. How <danahow@gmail.com>
> > ---
> >  t/test-lib.sh |   13 ++++++++-----
> >  1 files changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/t/test-lib.sh b/t/test-lib.sh
> > index f2c6bd3..d7838fc 100644
> > --- a/t/test-lib.sh
> > +++ b/t/test-lib.sh
> > @@ -268,11 +268,14 @@ test -d ../templates/blt || {
> >       error "You haven't built things yet, have you?"
> >  }
> >
> > -if ! test -x ../test-chmtime; then
> > -     echo >&2 'You need to build test-chmtime:'
> > -     echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
> > -     exit 1
> > -fi
> > +for prog in test-chmtime test-genrandom
> > +do
> > +     if ! test -x ../$prog; then
> > +             echo >&2 "You need to build $prog:"
> > +             echo >&2 "Run \"make $prog\" in the source (toplevel) directory"
> > +             exit 1
> > +     fi
> > +done
> >
> >  # Test repository
> >  test=trash
> > --
> > 1.5.2.rc0.71.g4342-dirty
>
> As these two are very small programs, why not always build them
> upon "make all", like this?
>
> ---
>  Makefile |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 60c41fd..817f8ef 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -933,13 +933,17 @@ endif
>
>  ### Testing rules
>
> +TEST_PROGRAMS = test-chmtime$X test-genrandom$X
> +
> +all:: $(TEST_PROGRAMS)
> +
>  # GNU make supports exporting all variables by "export" without parameters.
>  # However, the environment gets quite big, and some programs have problems
>  # with that.
>
>  export NO_SVN_TESTS
>
> -test: all test-chmtime$X test-genrandom$X
> +test: all
>         $(MAKE) -C t/ all
>
>  test-date$X: test-date.c date.o ctype.o
>
>
>


-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell

```

## Junio C Hamano, 2007-04-28 22:48

Subject: Re: [PATCH] Ensure test-genrandom availability for t5301/t5302
Message-ID: <7vodl8i08o.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vodl8i08o.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <56b7f5510704281536u5b5751a0k504a5ec0f8a36cf7@mail.gmail.com>

```
"Dana How" <danahow@gmail.com> writes:

> Either way is fine with me.
> I just don't want any one to have the nasty surprise I had --
> fortunately I figured it out quickly.
>
> So you will apply your patch?

Perhaps.  I've known about this for some time, but it is usually
not a problem if you do "make test" from the toplevel, hence it
was a low priority for me.

```
