diff mbox series

[v2] doc: add 'cd' command before 'make check-gcc' command in install.texi

Message ID 20200829113041.4859-1-hujiangping@cn.fujitsu.com
State New
Headers show
Series [v2] doc: add 'cd' command before 'make check-gcc' command in install.texi | expand

Commit Message

Hu, Jiangping Aug. 29, 2020, 11:30 a.m. UTC
This patch add 'cd' command before 'make check-gcc' command
when run the testsuite on selected tests.

Richard and I agree it would be good for clarity and
emphasis to have the cd in the example as well, although
the text above the example was trying to restrict that to
objdir/gcc.

Tested on x86_64. OK for master?

Regards!
Hujp

---
 gcc/doc/install.texi | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Comments

Hans-Peter Nilsson Sept. 4, 2020, 8:15 p.m. UTC | #1
On Sat, 29 Aug 2020, Hu Jiangping wrote:

> This patch add 'cd' command before 'make check-gcc' command
> when run the testsuite on selected tests.

No, don't do that; those targets work fine from the toplevel
too, and then include the language libs.

> Richard and I agree it would be good for clarity and
> emphasis to have the cd in the example as well, although
> the text above the example was trying to restrict that to
> objdir/gcc.

Aha, I guess you misinterpreted the existing "cd @var{objdir};
make -k check", because I see no /gcc there.

Please remove the /gcc from the patch.

Some <specific>.exp just exist in the gcc dir, but that's not
the point of these examples and the extra iteration from the
toplevel doesn't take more than a second or two.  The bigger
risk is missing testing in the target libraries.

(Incidentally, while GNU make is required such that "-C objdir"
would be equivalent, for newcomers I agree the "cd" is
clearer in examples.)

brgds, H-P
Hu, Jiangping Sept. 7, 2020, 9:50 a.m. UTC | #2
Hi, H-P

Thanks for comment.

> On Sat, 29 Aug 2020, Hu Jiangping wrote:
> 
> > This patch add 'cd' command before 'make check-gcc' command
> > when run the testsuite on selected tests.
> 
> No, don't do that; those targets work fine from the toplevel
> too, and then include the language libs.
Yes, I know that 'make check-gcc' work well from the toplevel,
but 'make check-g++' does not. Is there anything wrong with
the Makefile?

I pasted the original error in the v1 submitting text.
https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552761.html

> 
> > Richard and I agree it would be good for clarity and
> > emphasis to have the cd in the example as well, although
> > the text above the example was trying to restrict that to
> > objdir/gcc.
> 
> Aha, I guess you misinterpreted the existing "cd @var{objdir};
> make -k check", because I see no /gcc there.
Does the "cd @var{objdir}; make -k check" mean to execute command
from the toplevel.

I understand the context like this:
1. We can execute 'make -k check' from the toplevel to run all testsuites
2. And also, We can execute 'make check-gcc' from gcc subdirectory
   to run selected targets
3. And 'A more selective way', We can execute command with 'RUNTESTFLAGS' 
   option to run selected test(s).

	"In order to run sets of tests selectively, there are targets
	@samp{make check-gcc}, @samp{make check-g++} and language specific
	@samp{make check-c},
	@samp{make check-c++}, @samp{make check-d}, @samp{make check-fortran},
	@samp{make check-ada}, @samp{make check-objc}, @samp{make check-obj-c++},
	@samp{make check-lto}
	in the @file{gcc} subdirectory of the object directory.  You can also
	just run @samp{make check} in a subdirectory of the object directory."

I think the text above the 'make check-gcc' command implies point 2.
So, if the following commands which are examples of point 3 are also
executed from gcc subdirectory, it will make the context more logical
(The tests to be performed are more specific than point 2).

But it does not mean the commands must be executed from gcc subdirectory.
If anyone wants to execute the testsuites including the target libraries,
he should refer to other documents, or directly the Makefile under toplevel.
Or we can make a note here to illustrate that.

	i.e.:
	Note that if run 'make check-testsuite' from the object directory,
      not only the tests under gcc subdirectory but also the tests under
      the target libriaries will be performed.

What do you think?

Regards!
Hujp

> 
> Please remove the /gcc from the patch.
> 
> Some <specific>.exp just exist in the gcc dir, but that's not
> the point of these examples and the extra iteration from the
> toplevel doesn't take more than a second or two.  The bigger
> risk is missing testing in the target libraries.
> 
> (Incidentally, while GNU make is required such that "-C objdir"
> would be equivalent, for newcomers I agree the "cd" is
> clearer in examples.)
> 
> brgds, H-P
>
Hans-Peter Nilsson Sept. 8, 2020, 2:29 a.m. UTC | #3
On Mon, 7 Sep 2020, Hu, Jiangping wrote:
> Hi, H-P
>
> Thanks for comment.
>
> > On Sat, 29 Aug 2020, Hu Jiangping wrote:
> >
> > > This patch add 'cd' command before 'make check-gcc' command
> > > when run the testsuite on selected tests.
> >
> > No, don't do that; those targets work fine from the toplevel
> > too, and then include the language libs.
> Yes, I know that 'make check-gcc' work well from the toplevel,
> but 'make check-g++' does not. Is there anything wrong with
> the Makefile?

IIUC check-g++ is somewhat a historic artefact, but for
consistency it should be added to the toplevel Makefile too as
a synonym for check-c++.

> 	i.e.:
> 	Note that if run 'make check-testsuite' from the object directory,
>       not only the tests under gcc subdirectory but also the tests under
>       the target libriaries will be performed.

(There's no "make check-testsuite".)

> What do you think?

I think that after re-reading the patch, I retract my objection,
thanks.

FWIW, note also "check-gcc-<LANGUAGE>" where LANGUAGE="c, c++,
fortran, ada" which do consider the library testsuite.

brgds, H-P
Hu, Jiangping Sept. 8, 2020, 10:18 a.m. UTC | #4
Hi, H-P

> > > On Sat, 29 Aug 2020, Hu Jiangping wrote:
> > >
> > > > This patch add 'cd' command before 'make check-gcc' command
> > > > when run the testsuite on selected tests.
> > >
> > > No, don't do that; those targets work fine from the toplevel
> > > too, and then include the language libs.
> > Yes, I know that 'make check-gcc' work well from the toplevel,
> > but 'make check-g++' does not. Is there anything wrong with
> > the Makefile?
> 
> IIUC check-g++ is somewhat a historic artefact, but for
> consistency it should be added to the toplevel Makefile too as
> a synonym for check-c++.
Thanks for your suggestion. I'm submitting a patch for that.
Any advice will be appreciated.

> 
> > 	i.e.:
> > 	Note that if run 'make check-testsuite' from the object directory,
> >       not only the tests under gcc subdirectory but also the tests under
> >       the target libriaries will be performed.
> 
> (There's no "make check-testsuite".)
Oh, I mean 'check-@var{testsuite}'.

If the patch for Makefile is ok, then the patch here will be modified accordingly. 
For example, it is no need to add cd objdir/gcc before the ‘make check-<testsuite>’
commands, but in the text above the commands we need to describe the difference
between the targets in the gcc subdirectory and the object directory.

Regards!
Hujp

> 
> > What do you think?
> 
> I think that after re-reading the patch, I retract my objection,
> thanks.
> 
> FWIW, note also "check-gcc-<LANGUAGE>" where LANGUAGE="c, c++,
> fortran, ada" which do consider the library testsuite.
> 
> brgds, H-P
>
diff mbox series

Patch

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 5330bf3bb29..1560615bf3c 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2963,8 +2963,9 @@  on a simulator as described at @uref{http://gcc.gnu.org/simtest-howto.html}.
 @section How can you run the testsuite on selected tests?
 
 In order to run sets of tests selectively, there are targets
-@samp{make check-gcc} and language specific @samp{make check-c},
-@samp{make check-c++}, @samp{make check-d} @samp{make check-fortran},
+@samp{make check-gcc}, @samp{make check-g++} and language specific
+@samp{make check-c},
+@samp{make check-c++}, @samp{make check-d}, @samp{make check-fortran},
 @samp{make check-ada}, @samp{make check-objc}, @samp{make check-obj-c++},
 @samp{make check-lto}
 in the @file{gcc} subdirectory of the object directory.  You can also
@@ -2975,14 +2976,14 @@  A more selective way to just run all @command{gcc} execute tests in the
 testsuite is to use
 
 @smallexample
-make check-gcc RUNTESTFLAGS="execute.exp @var{other-options}"
+cd @var{objdir}/gcc; make check-gcc RUNTESTFLAGS="execute.exp @var{other-options}"
 @end smallexample
 
 Likewise, in order to run only the @command{g++} ``old-deja'' tests in
 the testsuite with filenames matching @samp{9805*}, you would use
 
 @smallexample
-make check-g++ RUNTESTFLAGS="old-deja.exp=9805* @var{other-options}"
+cd @var{objdir}/gcc; make check-g++ RUNTESTFLAGS="old-deja.exp=9805* @var{other-options}"
 @end smallexample
 
 The file-matching expression following @var{filename}@command{.exp=} is treated
@@ -2991,8 +2992,8 @@  may be passed, although any whitespace must either be escaped or surrounded by
 single quotes if multiple expressions are desired. For example,
 
 @smallexample
-make check-g++ RUNTESTFLAGS="old-deja.exp=9805*\ virtual2.c @var{other-options}"
-make check-g++ RUNTESTFLAGS="'old-deja.exp=9805* virtual2.c' @var{other-options}"
+@dots{}"old-deja.exp=9805*\ virtual2.c @var{other-options}"
+@dots{}"'old-deja.exp=9805* virtual2.c' @var{other-options}"
 @end smallexample
 
 The @file{*.exp} files are located in the testsuite directories of the GCC
@@ -3010,7 +3011,7 @@  You can pass multiple options to the testsuite using the
 work outside the makefiles.  For example,
 
 @smallexample
-make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"
+cd @var{objdir}/gcc; make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"
 @end smallexample
 
 will run the standard @command{g++} testsuites (``unix'' is the target name
@@ -3063,7 +3064,7 @@  make -j@var{N} check-@var{testsuite}//@var{test-target}/@var{option1}/@var{optio
 For example,
 
 @smallexample
-make -j3 check-gcc//sh-hms-sim/@{-m1,-m2,-m3,-m3e,-m4@}/@{,-nofpu@}
+cd @var{objdir}/gcc; make -j3 check-gcc//sh-hms-sim/@{-m1,-m2,-m3,-m3e,-m4@}/@{,-nofpu@}
 @end smallexample
 
 will run three concurrent ``make-gcc'' testsuites, eventually testing all