[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [FYI] {maint} tests/README: update obsoleted advice
From: |
Stefano Lattarini |
Subject: |
Re: [FYI] {maint} tests/README: update obsoleted advice |
Date: |
Sun, 22 May 2011 19:07:25 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
On Sunday 22 May 2011, Ralf Wildenhues wrote:
> * Stefano Lattarini wrote on Fri, May 20, 2011 at 10:21:09PM CEST:
> > * tests/README (Section "Writing test cases" subsection "Do"):
> > Do not suggest to use the `*-p.test' pattern for the names of
> > hand-written tests which use the `parallel-tests' Automake option.
> > Not only is this not respected by the existing tests, but it is
> > more likely to cause conflicts with auto-generated tests.
> > So, suggest to *avoid* using the `*-p.test' pattern in names
> > of hand-written tests instead.
> > (Section "Writing test cases" subsection "Do not"): When
> > suggesting not to override Makefile variables using command
> > line arguments, do not use the badly outdated variables `U'
> > and 'ANSI2KNR' in the example; instead, use the more common
> > and typical `DESTDIR'.
>
> Actually, this change has a slight technical error: when some variable
> is never initialized in the Makefile, -e is not necessary in order to
> override it. DESTDIR is such a variable: we ensure that we do not ever
> initialize it. And as such, it is quite portable to use
> make DESTDIR=/foo/bar install
>
> and in fact, quite widely used.
>
You're perfectly right.
> Can we use some other variable as example? How about prefix?
>
Seems good. I've prepared the attached patch (in your name, with me as
co-author in ChangeLog). I'll wait for your ACK before pushing.
Sorry for the noise,
Stefano
From aa6883fdcf1e7f21ea81fe4745c0018a9398d43f Mon Sep 17 00:00:00 2001
Message-Id: <address@hidden>
From: Ralf Wildenhues <address@hidden>
Date: Sun, 22 May 2011 19:02:27 +0200
Subject: [PATCH] tests/README: fix example about `make -e' usage
* tests/README (Section "Writing test cases" subsection "Do"): When
some variable is never initialized in the Makefile, `-e' is not
necessary in order to override it. DESTDIR is such a variable: we
ensure that we do not ever initialize it. And as such, it is quite
portable to use:
$ make DESTDIR=/foo/bar install
and in fact, quite widely used.
So our example about when `make -e' is required, which references
the `DESTDIR' variable, is poorly chosen, if not downright wrong.
Rewrite it to use `prefix' as the overridden variable instead.
---
ChangeLog | 15 +++++++++++++++
tests/README | 6 +++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3631129..583d3d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2011-05-22 Ralf Wildenhues <address@hidden>
+ Stefano Lattarini <address@hidden>
+
+ tests/README: fix example about `make -e' usage
+ * tests/README (Section "Writing test cases" subsection "Do"): When
+ some variable is never initialized in the Makefile, `-e' is not
+ necessary in order to override it. DESTDIR is such a variable: we
+ ensure that we do not ever initialize it. And as such, it is quite
+ portable to use:
+ $ make DESTDIR=/foo/bar install
+ and in fact, quite widely used.
+ So our example about when `make -e' is required, which references
+ the `DESTDIR' variable, is poorly chosen, if not downright wrong.
+ Rewrite it to use `prefix' as the overridden variable instead.
+
2011-05-20 Stefano Lattarini <address@hidden>
testsuite: avoid re-running few tests with 'parallel-tests' option
diff --git a/tests/README b/tests/README
index 9680a54..2b5b5af 100644
--- a/tests/README
+++ b/tests/README
@@ -181,11 +181,11 @@ Do not
here.)
Do not override Makefile variables using make arguments, as in e.g.:
- $MAKE DESTDIR=/foo/bar install
+ $MAKE prefix=/opt install
This is not portable for recursive targets (targets that call a
- sub-make may not pass `DESTDIR=/foo/bar' along). Use the following
+ sub-make may not pass `prefix=/opt' along). Use the following
instead:
- DESTDIR=/foo/bar $MAKE -e install
+ prefix=/opt $MAKE -e install
Do not send a test case without signing a copyright disclaimer.
See http://sources.redhat.com/automake/contribute.html or
--
1.7.2.3