Imported Upstream version 4.4
[platform/upstream/make.git] / tests / README
1 The test suite was originally written by Steve McGee and Chris Arthur.
2 It is covered by the GNU General Public License (Version 2), described
3 in the file COPYING.  It has been maintained as part of GNU make proper
4 since GNU make 3.78.
5
6 This entire test suite, including all test files, are copyright and
7 distributed under the following terms:
8
9  -----------------------------------------------------------------------------
10  Copyright (C) 1992-2022 Free Software Foundation, Inc.
11  This file is part of GNU Make.
12
13  GNU Make is free software; you can redistribute it and/or modify it under the
14  terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 3 of the License, or (at your option) any later
16  version.
17
18  GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
19  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
20  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
21
22  You should have received a copy of the GNU General Public License along with
23  this program.  If not, see <http://www.gnu.org/licenses/>.
24  -----------------------------------------------------------------------------
25
26 The test suite requires Perl.  These days, you should have at least Perl 5.6.
27 Newer versions may be required: I don't test regularly with older versions
28 than what is installed by default on my development systems.
29
30 The test suite assumes that the first "diff" it finds on your PATH is
31 GNU diff, but that only matters if a test fails.
32
33 To run the test suite on a UNIX system, use "perl ./run_make_tests"
34 (or just "./run_make_tests" if you have a perl on your PATH).
35
36 To run the test suite on Windows NT or DOS systems, use
37 "perl.exe ./run_make-tests.pl".
38
39 By default, the test engine picks up the first executable called "make"
40 that it finds in your path.  You may use the -make_path option (i.e.,
41 "perl run_make_tests -make_path /usr/local/src/make-3.78/make") if
42 you want to run a particular copy.  This now works correctly with
43 relative paths and when make is called something other than "make" (like
44 "gmake").
45
46 Tests cannot end with a "~" character, as the test suite will ignore any
47 that do (I was tired of having it run my Emacs backup files as tests :))
48
49 Also, sometimes the tests may behave strangely on networked
50 filesystems.  You can use mkshadow to create a copy of the test suite in
51 /tmp or similar, and try again.  If the error disappears, it's an issue
52 with your network or file server, not GNU make (I believe).  This
53 shouldn't happen very often anymore: I've done a lot of work on the
54 tests to reduce the impacts of this situation.
55
56 A directory named "work" will be created when the tests are run which
57 will contain any makefiles and "diff" files of tests that fail so that
58 you may look at them afterward to see the output of make and the
59 expected result.
60
61 There is a -help option which will give you more information about the
62 other possible options for the test suite.
63
64
65 Open Issues
66 -----------
67
68 The test suite has a number of problems which should be addressed.  One VERY
69 serious one is that there is no real documentation.  You just have to see the
70 existing tests.  Use the newer tests: many of the tests haven't been updated
71 to use the latest/greatest test methods.  See the ChangeLogs for pointers.
72
73 The second serious problem is that it's not relocatable: when you build out of
74 the source tree it creates symlinks, which doesn't work on every system and is
75 just bogus to boot.
76
77 The third serious problem is that it's not parallelizable: it scribbles all
78 over its installation directory and so can only test one make at a time.
79
80 The fourth serious problem is that since the tests scribble all over the same
81 directory (a) they can interfere with each other and (b) we cannot preserve
82 the full environment for every test, if it involves creating temporary files
83 etc. as they must be deleted before the next test.
84
85 To solve these the suite should create a separate directory for EVERY test,
86 local to the build directory, and all temporary files should exist in that
87 directory.  The directory can be preserved on error, or removed if the test
88 succeeds (unless --keep is given).
89
90
91 Bugs
92 ----
93
94 Any complaints/suggestions/bugs/etc. for the test suite itself should be
95 handled the same way as normal GNU make bugs/problems (see the README for GNU
96 make).
97
98
99                                                 Paul D. Smith
100                                                 Chris Arthur