Changeset 503 for trunk/src/gmake/tests
- Timestamp:
- Sep 15, 2006, 7:09:38 AM (19 years ago)
- Location:
- trunk/src/gmake/tests
- Files:
-
- 1 deleted
- 43 edited
- 9 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/tests/ChangeLog
r281 r503 1 2006-04-01 Paul D. Smith <psmith@gnu.org> 2 3 * scripts/functions/realpath: Don't run tests with multiple 4 initial slashes on Windows: those paths mean something different. 5 6 2006-03-19 Paul D. Smith <psmith@gnu.org> 7 8 * scripts/features/parallelism: Test that the jobserver is 9 properly managed when we have to re-exec the master instance of 10 make. 11 12 2006-03-17 Boris Kolpackov <boris@kolpackov.net> 13 14 * scripts/features/statipattrules: Add tests for bug #16053. 15 16 2006-03-09 Paul Smith <psmith@gnu.org> 17 18 * scripts/features/escape: Use "pre:" not "p:" to avoid conflicts 19 with DOS drive letters. Fixes Savannah bug #15947. 20 21 * test_driver.pl (run_each_test): Set the status properly even 22 when a test fails to execute. Fixes Savannah bug #15942. 23 24 * scripts/functions/foreach: Use a different environment variable 25 other than PATH to avoid differences with Windows platforms. 26 Fixes Savannah bug #15938. 27 28 2006-03-05 Paul D. Smith <psmith@gnu.org> 29 30 * run_make_tests.pl (set_more_defaults): Add CYGWIN_NT as a port 31 type W32. Fixed Savannah bug #15937. 32 33 * scripts/features/default_names: Don't call error() when the test 34 fails. Fixes Savannah bug #15941. 35 36 2006-02-17 Paul D. Smith <psmith@gnu.org> 37 38 * scripts/features/targetvars: Test a complex construction which 39 guarantees that we have to merge variable lists of different 40 sizes. Tests for Savannah bug #15757. 41 42 2006-02-15 Paul D. Smith <psmith@gnu.org> 43 44 * scripts/functions/error: Make sure filename/lineno information 45 is related to where the error is expanded, not where it's set. 46 * scripts/functions/warning: Ditto. 47 * scripts/functions/foreach: Check for different error conditions. 48 * scripts/functions/word: Ditto. 49 * scripts/variables/negative: Test some variable reference failure 50 conditions. 51 * scripts/options/warn-undefined-variables: Test the 52 --warn-undefined-variables flag. 53 54 2006-02-09 Paul D. Smith <psmith@gnu.org> 55 56 * run_make_tests.pl (set_more_defaults): Update valgrind support 57 for newer versions. 58 * test_driver.pl (toplevel): Skip all hidden files/directories (ones 59 beginning with "."). 60 61 * scripts/functions/andor: Tests for $(and ..) and $(or ...) 62 functions. 63 64 2006-02-08 Boris Kolpackov <boris@kolpackov.net> 65 66 * scripts/features/parallelism: Add a test for bug #15641. 67 68 2006-02-06 Paul D. Smith <psmith@gnu.org> 69 70 * scripts/options/dash-W: Add a test for bug #15341. 71 72 2006-01-03 Paul D. Smith <psmith@gnu.org> 73 74 * scripts/variables/automatic: Add a test for bug #8154. 75 76 * README: Update to reflect the current state of the test suite. 77 78 2005-12-12 Paul D. Smith <psmith@gnu.org> 79 80 * scripts/features/parallelism, scripts/functions/wildcard, 81 scripts/targets/FORCE, scripts/targets/PHONY, 82 scripts/targets/SILENT: Use the default setting for 83 $delete_command. Fixes bug #15085. 84 85 * run_make_tests.pl (get_this_pwd) [VMS]: Use -no_ask with delete_file. 86 87 2005-12-11 Paul D. Smith <psmith@gnu.org> 88 89 * scripts/misc/general4: Test implicit rules with '$' in the 90 prereq list & prereq patterns. 91 * scripts/features/se_implicit: Add in .SECONDEXPANSION settings. 92 93 2005-12-09 Boris Kolpackov <boris@kolpackov.net> 94 95 * scripts/features/patternrules: Add a test for bug #13022. 96 97 2005-12-07 Boris Kolpackov <boris@kolpackov.net> 98 99 * scripts/features/double_colon: Add a test for bug #14334. 100 101 2005-11-17 Boris Kolpackov <boris@kolpackov.net> 102 103 * scripts/functions/flavor: Add a test for the flavor function. 104 105 2005-11-14 Boris Kolpackov <boris@kolpackov.net> 106 107 * scripts/variables/INCLUDE_DIRS: Add a test for the .INCLUDE_DIRS 108 special variable. 109 110 2005-10-24 Paul D. Smith <psmith@gnu.org> 111 112 * scripts/misc/general4: Test '$$' in prerequisites list. 113 * scripts/features/statipattrules: Rewrite to use run_make_test(). 114 Add various static pattern info. 115 * scripts/features/se_statpat: Enable .SECONDEXPANSION target. 116 * scripts/features/se_explicit: Add tests for handling '$$' in 117 prerequisite lists with and without setting .SECONDEXPANSION. 118 * scripts/features/order_only: Convert to run_make_test(). 119 * run_make_tests.pl (set_more_defaults): If we can't get the value 120 of $(MAKE) from make, then fatal immediately. 121 122 2005-08-31 Paul D. Smith <psmith@gnu.org> 123 124 * run_make_tests.pl (get_this_pwd): Require the POSIX module (in 125 an eval to trap errors) and if it exists, use POSIX::getcwd to 126 find the working directory. If it doesn't exist, go back to the 127 previous methods. This tries to be more accurate on Windows 128 systems. 129 130 2005-08-29 Paul D. Smith <psmith@gnu.org> 131 132 * scripts/functions/abspath: Add some text to the error messages 133 to get a better idea of what's wrong. Make warnings instead of 134 errors. 135 136 * scripts/features/patspecific_vars: Don't use "test", which is 137 UNIX specific. Print the values and let the test script match 138 them. 139 140 2005-08-25 Paul Smith <psmith@gnu.org> 141 142 * scripts/variables/SHELL: Use a /./ prefix instead of //: the 143 former works better with non-UNIX environments. Fixes Savannah 144 bug #14129. 145 146 2005-08-13 Boris Kolpackov <boris@kolpackov.net> 147 148 * scripts/functions/wildcard: Wrap calls to $(wildcard ) with 149 $(sort) so that the resulting order is no longer filesystem- 150 dependant. 151 152 2005-08-10 Boris Kolpackov <boris@kolpackov.net> 153 154 * scripts/features/statipattrules: Add a test for Savannah bug #13881. 155 156 2005-08-07 Paul D. Smith <psmith@gnu.org> 157 158 * scripts/features/parallelism: Add a test for a bug reported by 159 Michael Matz (matz@suse.de) in which make exits without waiting 160 for all its children in some situations during parallel builds. 161 162 2005-07-08 Paul D. Smith <psmith@gnu.org> 163 164 * test_driver.pl: Reset the environment to a clean value every 165 time before we invoke make. I'm suspicious that the environment 166 isn't handled the same way in Windows as it is in UNIX, and some 167 variables are leaking out beyond the tests they are intended for. 168 Create an %extraENV hash tests can set to add more env. vars. 169 * tests/scripts/features/export: Change to use %extraENV. 170 * tests/scripts/functions/eval: Ditto. 171 * tests/scripts/functions/origin: Ditto. 172 * tests/scripts/options/dash-e: Ditto. 173 * tests/scripts/variables/SHELL: Ditto. 174 175 2005-06-27 Paul D. Smith <psmith@gnu.org> 176 177 * scripts/options/dash-W: Use 'echo >>' instead of touch to update 178 files. 179 * scripts/features/reinvoke: Rewrite to be safer on systems with 180 subsecond timestamps. 181 * scripts/features/patternrules: False exits with different error 182 codes on different systems (for example, Linux => 1, Solaris => 255). 183 184 * scripts/options/dash-W: Set the timestamp to foo.x in the future, 185 to be sure it will be considered updated when it's remade. 186 187 2005-06-26 Paul D. Smith <psmith@gnu.org> 188 189 * scripts/functions/shell: New test suite for the shell function. 190 191 2005-06-25 Paul D. Smith <psmith@gnu.org> 192 193 * scripts/features/include: Test include/-include/sinclude with no 194 arguments. Tests fix for Savannah bug #1761. 195 196 * scripts/misc/general3: Implement comprehensive testing of 197 backslash-newline behavior in command scripts: various types of 198 quoting, fast path / slow path, etc. 199 Tests fix for Savannah bug #1332. 200 201 * scripts/options/symlinks: Test symlinks to non-existent files. 202 Tests fix for Savannah bug #13280. 203 204 * scripts/misc/general3: Test semicolons in variable references. 205 Tests fix for Savannah bug #1454. 206 207 * scripts/variables/MAKE_RESTARTS: New file: test the 208 MAKE_RESTARTS variable. 209 * scripts/options/dash-B: Test re-exec doesn't loop infinitely. 210 Tests fix for Savannah bug #7566. 211 * scripts/options/dash-W: New file: test the -W flag, including 212 re-exec infinite looping. 213 214 2005-06-12 Paul D. Smith <psmith@gnu.org> 215 216 * scripts/misc/close_stdout: Add a test for Savannah bug #1328. 217 This test only works on systems that have /dev/full (e.g., Linux). 218 219 2005-06-09 Paul D. Smith <psmith@gnu.org> 220 221 * scripts/functions/foreach: Add a test for Savannah bug #11913. 222 223 2005-05-31 Boris Kolpackov <boris@kolpackov.net> 224 225 * scripts/features/include: Add a test for Savannah bug #13216. 226 * scripts/features/patternrules: Add a test for Savannah bug #13218. 227 1 228 2005-05-13 Paul D. Smith <psmith@gnu.org> 2 229 … … 308 535 2002-07-11 Paul D. Smith <psmith@gnu.org> 309 536 310 * run_make_tests.pl (valid_option): Add support for Valgrind 311 <http://developer.kde.org/~sewardj/>. Use -valgrind option to the 312 test suite. 537 * run_make_tests.pl (valid_option): Add support for Valgrind. Use 538 -valgrind option to the test suite. 313 539 (set_more_defaults): Set up the file descriptor to capture 314 540 Valgrind output. We have to unset its close-on-exec flag; we … … 594 820 595 821 ChangeLog file for the test suite created. 822 823 824 825 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 826 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 827 This file is part of GNU Make. 828 829 GNU Make is free software; you can redistribute it and/or modify it under the 830 terms of the GNU General Public License as published by the Free Software 831 Foundation; either version 2, or (at your option) any later version. 832 833 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 834 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 835 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 836 837 You should have received a copy of the GNU General Public License along with 838 GNU Make; see the file COPYING. If not, write to the Free Software 839 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -
trunk/src/gmake/tests/NEWS
r53 r503 160 160 161 161 Some new tests were added. 162 163 164 165 ------------------------------------------------------------------------------- 166 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 167 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 168 This file is part of GNU Make. 169 170 GNU Make is free software; you can redistribute it and/or modify it under the 171 terms of the GNU General Public License as published by the Free Software 172 Foundation; either version 2, or (at your option) any later version. 173 174 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 175 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 176 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 177 178 You should have received a copy of the GNU General Public License along with 179 GNU Make; see the file COPYING. If not, write to the Free Software 180 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -
trunk/src/gmake/tests/README
r53 r503 1 This is release 3.78 (September 6, 1999) of the GNU make test 2 suite. See the file NEWS for some of the changes since the last 3 release. 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. 4 5 5 This release is made by psmith@gnu.org to correspond to GNU make 3.78. 6 It won't work correctly for versions before that. In addition to some 7 infrastructure changes I've added a number of new tests. 6 This entire test suite, including all test files, are copyright and 7 distributed under the following terms: 8 8 9 Rob Tulloh has contributed changes to get the suite running on NT. 9 ----------------------------------------------------------------------------- 10 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 11 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 12 This file is part of GNU Make. 10 13 11 Eli Zaretskii and Esa A E Peuha <peuha@cc.helsinki.fi> have contributed 12 changes to get the suite running on DJGPP/DOS. 14 GNU Make is free software; you can redistribute it and/or modify it under the 15 terms of the GNU General Public License as published by the Free Software 16 Foundation; either version 2, or (at your option) any later version. 13 17 14 This package has a number of problems which preclude me from 15 distributing it with make as a default "make check" test suite. The 16 most serious of these is that it's not parallelizable: it scribbles all 17 over its installation directory and so can only test one make at a 18 time. I simply don't have time to do more with this than I am so far; 19 I'm very actively interested in finding someone willing to overhaul the 20 test suite infrastructure. If you're interested, contact me (see below)! 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 21 22 The test suite thus far has been written by Steve McGee, Chris Arthur, 23 and Paul D. Smith. It is covered by the GNU General Public License 24 (Version 2), described in the file COPYING. 22 You should have received a copy of the GNU General Public License along with 23 GNU Make; see the file COPYING. If not, write to the Free Software 24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 25 ----------------------------------------------------------------------------- 25 26 26 The test suite requires Perl and is known to work with Perl 4.036 and 27 Perl 5.004 (available from ftp.gnu.org, and portable to many machines). 28 Earlier or later versions may work; I don't know. It assumes that the 29 first "diff" it finds is GNU diff, but that only matters if a test 30 fails. 27 The test suite requires Perl. These days, you should have at least Perl 28 5.004 (available from ftp.gnu.org, and portable to many machines). It 29 used to work with Perl 4.036 but official support for Perl 4.x was 30 abandoned a long time ago, due to lack of testbeds, as well as interest. 31 32 The test suite assumes that the first "diff" it finds on your PATH is 33 GNU diff, but that only matters if a test fails. 31 34 32 35 To run the test suite on a UNIX system, use "perl ./run_make_tests" … … 44 47 45 48 Tests cannot end with a "~" character, as the test suite will ignore any 46 that do (I was tired of having it run my Emacs backup files as test :) 47 48 If you want to run the tests in parallel, you should use the mkshadow 49 script included here to create temporary "copies" (via symbolic links) 50 of the test suite, one for each parallel job. This is a pain and one 51 day maybe the test suite will be rewritten so it's no longer 52 necessary--volunteers welcome! 49 that do (I was tired of having it run my Emacs backup files as tests :)) 53 50 54 51 Also, sometimes the tests may behave strangely on networked 55 52 filesystems. You can use mkshadow to create a copy of the test suite in 56 53 /tmp or similar, and try again. If the error disappears, it's an issue 57 with your network or file server, not GNU make (I believe). 54 with your network or file server, not GNU make (I believe). This 55 shouldn't happen very often anymore: I've done a lot of work on the 56 tests to reduce the impacts of this situation. 58 57 59 58 The options/dash-l test will not really test anything if the copy of … … 73 72 other possible options for the test suite. 74 73 74 75 Open Issues 76 ----------- 77 78 The test suite has a number of problems which should be addressed. One 79 VERY serious one is that there is no real documentation. You just have 80 to see the existing tests. Use the newer tests: many of the tests 81 haven't been updated to use the latest/greatest test methods. See the 82 ChangeLog in the tests directory for pointers. 83 84 The second serious problem is that it's not parallelizable: it scribbles 85 all over its installation directory and so can only test one make at a 86 time. The third serious problem is that it's not relocatable: the only 87 way it works when you build out of the source tree is to create 88 symlinks, which doesn't work on every system and is bogus to boot. The 89 fourth serious problem is that it doesn't create its own sandbox when 90 running tests, so that if a test forgets to clean up after itself that 91 can impact future tests. 92 93 94 Bugs 95 ---- 96 75 97 Any complaints/suggestions/bugs/etc. for the test suite itself (as 76 opposed to problems in make that the suite finds) should be sent to 77 psmith@gnu.org. Enjoy! 98 opposed to problems in make that the suite finds) should be handled the 99 same way as normal GNU make bugs/problems (see the README for GNU make). 100 101 78 102 Paul D. Smith 79 103 Chris Arthur -
trunk/src/gmake/tests/mkshadow
-
Property svn:executable
set to
*
r53 r503 4 4 # Typically you'd put the shadow in /tmp or another local disk 5 5 # 6 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 7 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 8 # This file is part of GNU Make. 9 # 10 # GNU Make is free software; you can redistribute it and/or modify it under the 11 # terms of the GNU General Public License as published by the Free Software 12 # Foundation; either version 2, or (at your option) any later version. 13 # 14 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 # 18 # You should have received a copy of the GNU General Public License along with 19 # GNU Make; see the file COPYING. If not, write to the Free Software 20 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 6 21 7 22 case "$1" in -
Property svn:executable
set to
-
trunk/src/gmake/tests/run_make_tests
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/src/gmake/tests/run_make_tests.pl
-
Property svn:executable
set to
*
r281 r503 12 12 # (and others) 13 13 14 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 15 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 16 # This file is part of GNU Make. 17 # 18 # GNU Make is free software; you can redistribute it and/or modify it under the 19 # terms of the GNU General Public License as published by the Free Software 20 # Foundation; either version 2, or (at your option) any later version. 21 # 22 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 23 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 24 # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 25 # 26 # You should have received a copy of the GNU General Public License along with 27 # GNU Make; see the file COPYING. If not, write to the Free Software 28 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 29 14 30 $valgrind = 0; # invoke make with valgrind 31 $valgrind_args = '--num-callers=15 --tool=memcheck --leak-check=full'; 15 32 $pure_log = undef; 16 33 17 34 require "test_driver.pl"; 35 36 # Some target systems might not have the POSIX module... 37 $has_POSIX = eval { require "POSIX.pm" }; 18 38 19 39 #$SIG{INT} = sub { print STDERR "Caught a signal!\n"; die @_; }; … … 181 201 182 202 sub get_this_pwd { 183 if ($vos) { 184 $delete_command = "delete_file"; 203 $delete_command = 'rm -f'; 204 if ($has_POSIX) { 205 $__pwd = POSIX::getcwd(); 206 } elsif ($vos) { 207 $delete_command = "delete_file -no_ask"; 185 208 $__pwd = `++(current_dir)`; 186 } 187 else { 188 $delete_command = "rm"; 209 } else { 210 # No idea... just try using pwd as a last resort. 189 211 chop ($__pwd = `pwd`); 190 212 } … … 217 239 # This is probably not specific enough. 218 240 # 219 if ($osname =~ /Windows/i || $osname =~ /MINGW32/i ) {241 if ($osname =~ /Windows/i || $osname =~ /MINGW32/i || $osname =~ /CYGWIN_NT/i) { 220 242 $port_type = 'W32'; 221 243 } … … 249 271 # Find the full pathname of Make. For DOS systems this is more 250 272 # complicated, so we ask make itself. 251 $make_path = `sh -c 'echo "all:;\@echo \\\$(MAKE)" | $make_path -f-'`; 252 chop $make_path; 273 my $mk = `sh -c 'echo "all:;\@echo \\\$(MAKE)" | $make_path -f-'`; 274 chop $mk; 275 $mk or die "FATAL ERROR: Cannot determine the value of \$(MAKE):\n 276 'echo \"all:;\@echo \\\$(MAKE)\" | $make_path -f-' failed!\n"; 277 $make_path = $mk; 253 278 print "Make\t= `$make_path'\n" if $debug; 254 279 … … 304 329 305 330 if ($valgrind) { 306 # use POSIX qw(:fcntl_h);307 # require Fcntl;308 331 open(VALGRIND, "> valgrind.out") 309 332 || die "Cannot open valgrind.out: $!\n"; 310 333 # -q --leak-check=yes 311 $make_path = "valgrind --num-callers=15 --logfile-fd=".fileno(VALGRIND)." $make_path"; 334 exists $ENV{VALGRIND_ARGS} and $valgrind_args = $ENV{VALGRIND_ARGS}; 335 $make_path = "valgrind --log-fd=".fileno(VALGRIND)." $valgrind_args $make_path"; 312 336 # F_SETFD is 2 313 337 fcntl(VALGRIND, 2, 0) or die "fcntl(setfd) failed: $!\n"; -
Property svn:executable
set to
-
trunk/src/gmake/tests/scripts/features/default_names
r53 r503 8 8 9 9 open(MAKEFILE,"> $makefile"); 10 11 10 print MAKEFILE "FIRST: ; \@echo It chose GNUmakefile\n"; 12 13 11 close(MAKEFILE); 14 12 15 13 # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile. 16 14 # Just test what we can here (avoid Makefile versus makefile test). 17 # 18 if ($port_type eq 'UNIX') 19 { 15 16 if ($port_type eq 'UNIX') { 20 17 # Create another makefile called "makefile" 21 18 open(MAKEFILE,"> makefile"); 22 23 19 print MAKEFILE "SECOND: ; \@echo It chose makefile\n"; 24 25 20 close(MAKEFILE); 26 21 } 27 22 28 29 23 # Create another makefile called "Makefile" 30 24 open(MAKEFILE,"> Makefile"); 31 32 25 print MAKEFILE "THIRD: ; \@echo It chose Makefile\n"; 33 34 26 close(MAKEFILE); 35 27 36 28 37 29 &run_make_with_options("","",&get_logfile); 38 39 # Create the answer to what should be produced by this Makefile 40 $answer = "It chose GNUmakefile\n"; 41 42 # COMPARE RESULTS 43 44 &compare_output($answer,&get_logfile(1)) || &error("abort"); 30 &compare_output("It chose GNUmakefile\n",&get_logfile(1)); 45 31 unlink $makefile; 46 32 47 # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile. 48 # Just test what we can here (avoid Makefile versus makefile test). 49 # 50 if ($port_type eq 'UNIX') 51 { 52 $answer = "It chose makefile\n"; 53 33 if ($port_type eq 'UNIX') { 54 34 &run_make_with_options("","",&get_logfile); 55 56 &compare_output($answer,&get_logfile(1)) || &error("abort"); 35 &compare_output("It chose makefile\n",&get_logfile(1)); 57 36 unlink "makefile"; 58 37 } 59 38 60 $answer = "It chose Makefile\n";61 62 39 &run_make_with_options("","",&get_logfile); 63 64 &compare_output($answer,&get_logfile(1)) || &error("abort"); 40 &compare_output("It chose Makefile\n",&get_logfile(1)); 65 41 unlink "Makefile"; -
trunk/src/gmake/tests/scripts/features/double_colon
r53 r503 125 125 unlink('foo','f1.h','f2.h'); 126 126 127 128 # TEST 9: make sure all rules in s double colon family get executed 129 # (Savannah bug #14334). 130 # 131 132 &touch('one'); 133 &touch('two'); 134 135 run_make_test(' 136 .PHONY: all 137 all: result 138 139 result:: one 140 @echo $^ >>$@ 141 @echo $^ 142 143 result:: two 144 @echo $^ >>$@ 145 @echo $^ 146 147 ', 148 '', 149 'one 150 two'); 151 152 unlink('result','one','two'); 153 154 # This tells the test driver that the perl test script executed properly. 127 155 1; -
trunk/src/gmake/tests/scripts/features/errors
r281 r503 1 # -*-perl-*- 2 1 3 $description = "The following tests the -i option and the '-' in front of \n" 2 4 ."commands to test that make ignores errors in these commands\n" … … 15 17 if ($vos) 16 18 { 17 $ delete_command = "delete_file";19 $rm_command = "delete_file"; 18 20 } 19 21 else 20 22 { 21 $ delete_command = "rm";23 $rm_command = "rm"; 22 24 } 23 25 … … 27 29 28 30 print MAKEFILE "clean:\n" 29 ."\t-$ delete_command cleanit\n"30 ."\t$ delete_command foo\n"31 ."\t-$rm_command cleanit\n" 32 ."\t$rm_command foo\n" 31 33 ."clean2: \n" 32 ."\t$ delete_command cleanit\n"33 ."\t$ delete_command foo\n";34 ."\t$rm_command cleanit\n" 35 ."\t$rm_command foo\n"; 34 36 35 37 # END of Contents of MAKEFILE … … 40 42 41 43 unlink("cleanit"); 42 $cleanit_error = `sh -c "$ delete_command cleanit 2>&1"`;44 $cleanit_error = `sh -c "$rm_command cleanit 2>&1"`; 43 45 $delete_error_code = $? >> 8; 44 46 … … 46 48 # ------- 47 49 48 $answer = "$ delete_command cleanit\n"50 $answer = "$rm_command cleanit\n" 49 51 . $cleanit_error 50 52 ."$make_name: [clean] Error $delete_error_code (ignored)\n" 51 ."$ delete_command foo\n";53 ."$rm_command foo\n"; 52 54 53 55 &run_make_with_options($makefile,"",&get_logfile); … … 73 75 # ------- 74 76 75 $answer = "$ delete_command cleanit\n"77 $answer = "$rm_command cleanit\n" 76 78 . $cleanit_error 77 79 ."$make_name: [clean2] Error $delete_error_code (ignored)\n" 78 ."$ delete_command foo\n";80 ."$rm_command foo\n"; 79 81 80 82 &run_make_with_options($makefile,"clean2 -i",&get_logfile); -
trunk/src/gmake/tests/scripts/features/escape
r53 r503 7 7 Make sure that escaping of '#' works."; 8 8 9 open(MAKEFILE,"> $makefile");10 11 print MAKEFILE <<'EOF';12 $(path)foo : ; @echo cp $^ $@13 14 foo\ bar: ; @echo 'touch "$@"'15 16 sharp: foo\#bar.ext17 foo\#bar.ext: ; @echo foo\#bar.ext = '$@'18 EOF19 9 20 10 close(MAKEFILE); … … 23 13 # TEST 1 24 14 25 &run_make_with_options($makefile, "", &get_logfile); 26 $answer = "cp foo\n"; 27 &compare_output($answer,&get_logfile(1)); 15 run_make_test(' 16 $(path)foo : ; @echo "touch ($@)" 17 18 foo\ bar: ; @echo "touch ($@)" 19 20 sharp: foo\#bar.ext 21 foo\#bar.ext: ; @echo "foo#bar.ext = ($@)"', 22 '', 23 'touch (foo)'); 28 24 29 25 # TEST 2: This one should fail, since the ":" is unquoted. 30 26 31 &run_make_with_options($makefile, "path=p:", &get_logfile, 512); 32 $answer = "$makefile:1: *** target pattern contains no `%'. Stop.\n"; 33 &compare_output($answer,&get_logfile(1)); 27 run_make_test(undef, 28 'path=pre:', 29 "#MAKEFILE#:2: *** target pattern contains no `%'. Stop.", 30 512); 34 31 35 32 # TEST 3: This one should work, since we escape the ":". 36 33 37 &run_make_with_options($makefile, "'path=p\\:'", &get_logfile, 0); 38 $answer = "cp p:foo\n"; 39 &compare_output($answer,&get_logfile(1));34 run_make_test(undef, 35 "'path=pre\\:'", 36 'touch (pre:foo)'); 40 37 41 38 # TEST 4: This one should fail, since the escape char is escaped. 42 39 43 &run_make_with_options($makefile, "'path=p\\\\:'", &get_logfile, 512); 44 $answer = "$makefile:1: *** target pattern contains no `%'. Stop.\n"; 45 &compare_output($answer,&get_logfile(1)); 40 run_make_test(undef, 41 "'path=pre\\\\:'", 42 "#MAKEFILE#:2: *** target pattern contains no `%'. Stop.", 43 512); 46 44 47 45 # TEST 5: This one should work 48 46 49 &run_make_with_options($makefile, "'foo bar'", &get_logfile, 0); 50 $answer = "touch \"foo bar\"\n"; 51 &compare_output($answer,&get_logfile(1));47 run_make_test(undef, 48 "'foo bar'", 49 'touch (foo bar)'); 52 50 53 51 # TEST 6: Test escaped comments 54 52 55 &run_make_with_options($makefile, "sharp", &get_logfile, 0); 56 $answer = "foo#bar.ext = foo#bar.ext\n"; 57 &compare_output($answer,&get_logfile(1));53 run_make_test(undef, 54 'sharp', 55 'foo#bar.ext = (foo#bar.ext)'); 58 56 59 57 # This tells the test driver that the perl test script executed properly. -
trunk/src/gmake/tests/scripts/features/export
r53 r503 57 57 # TEST 1: make sure vars inherited from the parent are exported 58 58 59 $ ENV{FOO} = 1;59 $extraENV{FOO} = 1; 60 60 61 61 &run_make_with_options($makefile,"",&get_logfile,0); … … 65 65 66 66 &compare_output($answer,&get_logfile(1)); 67 68 delete $ENV{FOO};69 67 70 68 # TEST 2: global export. Explicit unexport takes precedence. … … 238 236 close(MAKEFILE); 239 237 240 @ ENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10);238 @extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10); 241 239 242 240 &run_make_with_options($makefile5,"",&get_logfile,0); … … 244 242 &compare_output($answer,&get_logfile(1)); 245 243 246 delete @ENV{qw(A B C D E F G H I J)};247 248 244 249 245 # This tells the test driver that the perl test script executed properly. -
trunk/src/gmake/tests/scripts/features/include
r285 r503 79 79 ); 80 80 81 81 82 # Test inheritance of dontcare flag when rebuilding makefiles. 82 83 # … … 91 92 92 93 1; 94 95 96 # Make sure that we don't die when the command fails but we dontcare. 97 # (Savannah bug #13216). 98 # 99 run_make_test(' 100 .PHONY: all 101 all:; @: 102 103 -include foo 104 105 foo: bar; @: 106 107 bar:; @exit 1 108 ', '', ''); 109 110 # Check include, sinclude, -include with no filenames. 111 # (Savannah bug #1761). 112 113 run_make_test(' 114 .PHONY: all 115 all:; @: 116 include 117 -include 118 sinclude', '', ''); 119 120 1; -
trunk/src/gmake/tests/scripts/features/order_only
r285 r503 6 6 prerequisites and ensure they behave properly. Test the \$| variable."; 7 7 8 open(MAKEFILE,"> $makefile"); 8 # TEST #0 -- Basics 9 9 10 print MAKEFILE <<'EOF'; 10 run_make_test(' 11 %r: | baz ; @echo $< $^ $| 12 bar: foo 13 foo:;@: 14 baz:;@:', 15 '', "foo foo baz\n"); 16 17 # TEST #1 -- First try: the order-only prereqs need to be built. 18 19 run_make_test(q! 11 20 foo: bar | baz 12 21 @echo '$$^ = $^' … … 17 26 18 27 bar baz: 19 touch $@ 20 EOF 21 22 close(MAKEFILE); 23 24 25 # TEST #1 -- just the syntax 26 27 &run_make_with_options($makefile, "", &get_logfile); 28 $answer = "touch bar\ntouch baz\n\$^ = bar\n\$| = baz\ntouch foo\n"; 29 &compare_output($answer,&get_logfile(1)); 28 touch $@!, 29 '', "touch bar\ntouch baz\n\$^ = bar\n\$| = baz\ntouch foo\n"); 30 30 31 31 32 32 # TEST #2 -- now we do it again: baz is PHONY but foo should _NOT_ be updated 33 33 34 &run_make_with_options($makefile, "", &get_logfile); 35 $answer = "touch baz\n"; 36 &compare_output($answer,&get_logfile(1)); 34 run_make_test(undef, '', "touch baz\n"); 37 35 38 36 unlink(qw(foo bar baz)); 39 37 40 # T est prereqs that are both order and non-order38 # TEST #3 -- Make sure the order-only prereq was promoted to normal. 41 39 42 $makefile2 = &get_tmpfile; 43 44 open(MAKEFILE,"> $makefile2"); 45 46 print MAKEFILE <<'EOF'; 40 run_make_test(q! 47 41 foo: bar | baz 48 42 @echo '$$^ = $^' … … 55 49 56 50 bar baz: 57 touch $@ 58 EOF 59 60 close(MAKEFILE); 61 62 # TEST #3 -- Make sure the order-only prereq was promoted to normal. 63 64 &run_make_with_options($makefile2, "", &get_logfile); 65 $answer = "touch bar\ntouch baz\n\$^ = bar baz\n\$| = \ntouch foo\n"; 66 &compare_output($answer,&get_logfile(1)); 51 touch $@!, 52 '', "touch bar\ntouch baz\n\$^ = bar baz\n\$| = \ntouch foo\n"); 67 53 68 54 69 55 # TEST #4 -- now we do it again 70 56 71 &run_make_with_options($makefile2, "", &get_logfile); 72 $answer = "touch baz\n\$^ = bar baz\n\$| = \ntouch foo\n"; 73 &compare_output($answer,&get_logfile(1)); 57 run_make_test(undef, '', "touch baz\n\$^ = bar baz\n\$| = \ntouch foo\n"); 74 58 75 59 unlink(qw(foo bar baz)); … … 77 61 # Test empty normal prereqs 78 62 79 $makefile3 = &get_tmpfile; 63 # TEST #5 -- make sure the parser was correct. 80 64 81 open(MAKEFILE,"> $makefile3"); 82 83 print MAKEFILE <<'EOF'; 65 run_make_test(q! 84 66 foo:| baz 85 67 @echo '$$^ = $^' … … 90 72 91 73 baz: 92 touch $@ 93 EOF 94 95 close(MAKEFILE); 96 97 # TEST #5 -- make sure the parser was correct. 98 99 &run_make_with_options($makefile3, "", &get_logfile); 100 $answer = "touch baz\n\$^ = \n\$| = baz\ntouch foo\n"; 101 &compare_output($answer,&get_logfile(1)); 102 74 touch $@!, 75 '', "touch baz\n\$^ = \n\$| = baz\ntouch foo\n"); 103 76 104 77 # TEST #6 -- now we do it again: this time foo won't be built 105 78 106 &run_make_with_options($makefile3, "", &get_logfile); 107 $answer = "touch baz\n"; 108 &compare_output($answer,&get_logfile(1)); 79 run_make_test(undef, '', "touch baz\n"); 109 80 110 81 unlink(qw(foo baz)); … … 112 83 # Test order-only in pattern rules 113 84 114 $makefile4 = &get_tmpfile; 85 # TEST #7 -- make sure the parser was correct. 115 86 116 open(MAKEFILE,"> $makefile4"); 117 118 print MAKEFILE <<'EOF'; 87 run_make_test(q! 119 88 %.w : %.x | baz 120 89 @echo '$$^ = $^' … … 126 95 .PHONY: baz 127 96 foo.x baz: 128 touch $@ 129 EOF 130 131 close(MAKEFILE); 132 133 # TEST #7 -- make sure the parser was correct. 134 135 &run_make_with_options($makefile4, "", &get_logfile); 136 $answer = "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n"; 137 &compare_output($answer,&get_logfile(1)); 97 touch $@!, 98 '', 99 "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n"); 138 100 139 101 # TEST #8 -- now we do it again: this time foo.w won't be built 140 102 141 &run_make_with_options($makefile4, "", &get_logfile); 142 $answer = "touch baz\n"; 143 &compare_output($answer,&get_logfile(1)); 103 run_make_test(undef, '', "touch baz\n"); 144 104 145 105 unlink(qw(foo.w foo.x baz)); … … 152 112 bar: foo 153 113 foo:;@: 154 baz:;@: 155 ','', "foo foo baz\n");114 baz:;@:', 115 '', "foo foo baz\n"); 156 116 157 117 -
trunk/src/gmake/tests/scripts/features/parallelism
r285 r503 19 19 20 20 if ($vos) { 21 $delete_command = "delete_file -no_ask";22 21 $sleep_command = "sleep -seconds"; 23 22 } 24 23 else { 25 $delete_command = "rm -f";26 24 $sleep_command = "sleep"; 27 25 } … … 84 82 '-j2', "first\nfirst\nsecond\nsecond"); 85 83 84 # Michael Matz <matz@suse.de> reported a bug where if make is running in 85 # parallel without -k and two jobs die in a row, but not too close to each 86 # other, then make will quit without waiting for the rest of the jobs to die. 87 88 run_make_test(" 89 .PHONY: all fail.1 fail.2 fail.3 ok 90 all: fail.1 ok fail.2 fail.3 91 92 fail.1 fail.2 fail.3: 93 \@sleep \$(patsubst fail.%,%,\$\@) 94 \@echo Fail 95 \@exit 1 96 97 ok: 98 \@sleep 4 99 \@echo Ok done", 100 '-rR -j5', 'Fail 101 #MAKE#: *** [fail.1] Error 1 102 #MAKE#: *** Waiting for unfinished jobs.... 103 Fail 104 #MAKE#: *** [fail.2] Error 1 105 Fail 106 #MAKE#: *** [fail.3] Error 1 107 Ok done', 108 512); 109 110 111 # Test for Savannah bug #15641. 112 # 113 run_make_test(' 114 .PHONY: all 115 all:; @: 116 117 -include foo.d 118 119 foo.d: comp 120 @echo building $@ 121 122 comp: mod_a.o mod_b.o; @: 123 124 mod_a.o mod_b.o: 125 @exit 1 126 ', '-j2', ''); 127 128 129 # Make sure that all jobserver FDs are closed if we need to re-exec the 130 # master copy. 131 # 132 # First, find the "default" file descriptors we normally use 133 # Then make sure they're still used. 134 # 135 # Right now we don't have a way to run a makefile and capture the output 136 # without checking it, so we can't really write this test. 137 138 # run_make_test(' 139 # submake: ; @$(MAKE) --no-print-directory -f #MAKEFILE# fdprint 5>output 140 141 # dependfile: ; @echo FOO=bar > $@ 142 143 # INCL := true 144 145 # FOO=foo 146 # ifeq ($(INCL),true) 147 # -include dependfile 148 # endif 149 150 # fdprint: ; @echo $(filter --jobserver%,$(MAKEFLAGS)) 151 152 # recurse: ; @$(MAKE) --no-print-directory -f #MAKEFILE# submake INCL=true', 153 # '-j2 INCL=false fdprint', 154 # 'bar'); 155 156 # unlink('dependfile', 'output'); 157 158 159 # # Do it again, this time where the include is done by the non-master make. 160 # run_make_test(undef, '-j2 recurse INCL=false', 'bar'); 161 162 # unlink('dependfile', 'output'); 163 86 164 1; -
trunk/src/gmake/tests/scripts/features/patspecific_vars
r285 r503 68 68 69 69 /bar: 70 @ test "$(foo)" = "$$foo"71 ', '', ' ');70 @echo $(foo) $$foo 71 ', '', 'foo foo'); 72 72 73 73 -
trunk/src/gmake/tests/scripts/features/patternrules
r282 r503 24 24 # 1 - existing file 25 25 %.1: void 26 @ false26 @exit 1 27 27 %.1: #MAKEFILE# 28 @ true28 @exit 0 29 29 30 30 # 2 - phony 31 31 %.2: void 32 @ false32 @exit 1 33 33 %.2: 2.phony 34 @ true34 @exit 0 35 35 .PHONY: 2.phony 36 36 37 37 # 3 - implicit-phony 38 38 %.3: void 39 @ false39 @exit 1 40 40 %.3: 3.implicit-phony 41 @ true41 @exit 0 42 42 43 43 3.implicit-phony: … … 96 96 unlink("$dir/foo.c"); 97 97 98 99 # TEST #4: make sure precious flag is set properly for targets 100 # that are built via implicit rules (Savannah bug #13218). 101 # 102 run_make_test(' 103 .DELETE_ON_ERROR: 104 105 .PRECIOUS: %.bar 106 107 %.bar:; @touch $@ && exit 1 108 109 $(dir)/foo.bar: 110 111 ', 112 "dir=$dir", 113 "#MAKE#: *** [$dir/foo.bar] Error 1", 114 512); 115 116 unlink("$dir/foo.bar"); 117 118 119 # TEST #5: make sure targets of a macthed implicit pattern rule never 120 # never considered intermediate (Savannah bug #13022). 121 # 122 run_make_test(' 123 .PHONY: all 124 all: foo.c foo.o 125 126 %.h %.c: %.in 127 touch $*.h 128 touch $*.c 129 130 %.o: %.c %.h 131 echo $+ >$@ 132 133 %.o: %.c 134 @echo wrong rule 135 136 foo.in: 137 touch $@ 138 139 ', 140 '', 141 'touch foo.in 142 touch foo.h 143 touch foo.c 144 echo foo.c foo.h >foo.o'); 145 146 unlink('foo.in', 'foo.h', 'foo.c', 'foo.o'); 147 98 148 # This tells the test driver that the perl test script executed properly. 99 149 1; -
trunk/src/gmake/tests/scripts/features/reinvoke
r53 r503 8 8 file, then touch the temp file to make it newer than the makefile."; 9 9 10 $makefile2 = &get_tmpfile; 11 $makefile_orig = &get_tmpfile; 10 $omkfile = $makefile; 12 11 13 open(MAKEFILE,"> $makefile"); 12 &utouch(-600, 'incl.mk'); 13 # For some reason if we don't do this then the test fails for systems 14 # with sub-second timestamps, maybe + NFS? Not sure. 15 &utouch(-1, 'incl-1.mk'); 14 16 15 print MAKEFILE <<EOM; 17 run_make_test(' 18 all: ; @echo running rules. 16 19 17 all: ; \@echo 'running rules.' 20 #MAKEFILE# incl.mk: incl-1.mk 21 @echo rebuilding $@ 22 @echo >> $@ 18 23 19 $makefile $makefile2: $makefile_orig 20 \@echo 'rebuilding \$\@.' 21 \@echo >> \$\@ 24 include incl.mk', 25 '', "rebuilding incl.mk\nrunning rules.\n"); 22 26 23 include $makefile2 27 # Make sure updating the makefile itself also works 24 28 25 EOM 29 &utouch(-600, $omkfile); 26 30 27 close(MAKEFILE);31 run_make_test(undef, '', "rebuilding #MAKEFILE#\nrunning rules.\n"); 28 32 29 &utouch(-10, $makefile, $makefile2); 30 &touch($makefile_orig); 33 &rmfiles('incl.mk', 'incl-1.mk'); 31 34 32 &run_make_with_options($makefile, "", &get_logfile, 0);33 34 # Create the answer to what should be produced by this Makefile35 36 $answer = "rebuilding $makefile2.\nrebuilding $makefile.\nrunning rules.\n";37 38 &compare_output($answer,&get_logfile(1))39 && unlink "$makefile_orig";40 35 41 36 # In this test we create an included file that's out-of-date, but then 42 37 # the rule doesn't update it. Make shouldn't re-exec. 43 38 44 $makefile3 = &get_tmpfile; 39 &utouch(-600, 'b','a'); 40 #&utouch(-10, 'a'); 41 &touch('c'); 45 42 46 open(MAKEFILE, "> $makefile3"); 47 print MAKEFILE <<'EOM'; 43 run_make_test(' 48 44 SHELL = /bin/sh 49 45 … … 56 52 c: ; echo >> $@ 57 53 58 include $(F) 59 EOM 60 61 close(MAKEFILE); 62 63 &utouch(-20, 'b','a'); 64 #&utouch(-10, 'a'); 65 &touch('c'); 66 67 # First try with the file that's not updated "once removed" from the 68 # file we're including. 69 70 &run_make_with_options($makefile3, "F=a", &get_logfile, 0); 71 72 $answer = "[ -f b ] || echo >> b\nhello\n"; 73 &compare_output($answer,&get_logfile(1)); 54 include $(F)', 55 'F=a', "[ -f b ] || echo >> b\nhello\n"); 74 56 75 57 # Now try with the file we're not updating being the actual file we're 76 58 # including: this and the previous one test different parts of the code. 77 59 78 &run_make_with_options($makefile3, "F=b", &get_logfile, 0); 60 run_make_test(undef, "F=b", "[ -f b ] || echo >> b\nhello\n") 79 61 80 $answer = "[ -f b ] || echo >> b\nhello\n"; 81 &compare_output($answer,&get_logfile(1)); 82 83 unlink('a','b','c'); 62 &rmfiles('a','b','c'); 84 63 85 64 # This tells the test driver that the perl test script executed properly. -
trunk/src/gmake/tests/scripts/features/se_explicit
r282 r503 4 4 $details = ""; 5 5 6 # Test #1: automatic variables. 6 # TEST #0: Test handing of '$' in prerequisites with and without second 7 # expansion. 8 9 run_make_test(q! 10 ifdef SE 11 .SECONDEXPANSION: 12 endif 13 foo$$bar: bar$$baz bar$$biz ; @echo '$@ : $^' 14 PRE = one two 15 bar$$baz: $$(PRE) 16 baraz: $$(PRE) 17 PRE = three four 18 .DEFAULT: ; @echo '$@' 19 !, 20 '', 21 "\$\nbar\$biz\nfoo\$bar : bar\$baz bar\$biz"); 22 23 run_make_test(undef, 'SE=1', "three\nfour\nbariz\nfoo\$bar : baraz bariz"); 24 25 # TEST #1: automatic variables. 7 26 # 8 27 run_make_test(' 28 .SECONDEXPANSION: 9 29 .DEFAULT: ; @echo $@ 10 30 … … 42 62 # 43 63 run_make_test(' 64 .SECONDEXPANSION: 44 65 .DEFAULT: ; @echo $@ 45 66 … … 60 81 # 61 82 run_make_test(' 83 .SECONDEXPANSION: 62 84 .DEFAULT: ; @echo $@ 63 85 -
trunk/src/gmake/tests/scripts/features/se_implicit
r282 r503 13 13 # 14 14 run_make_test(' 15 .SECONDEXPANSION: 15 16 .DEFAULT: ; @echo $@ 16 17 … … 61 62 # 62 63 run_make_test(' 64 .SECONDEXPANSION: 63 65 foo.x: 64 66 … … 82 84 # 83 85 run_make_test(' 86 .SECONDEXPANSION: 84 87 .DEFAULT: ; @echo $@ 85 88 … … 133 136 # 134 137 run_make_test(' 138 .SECONDEXPANSION: 135 139 $(dir)/tmp/bar.o: 136 140 … … 154 158 # 155 159 run_make_test(' 160 .SECONDEXPANSION: 156 161 $(dir)/tmp/foo.o: $(dir)/tmp/foo.c 157 162 $(dir)/tmp/foo.c: ; @echo $@ … … 172 177 # 173 178 run_make_test(' 179 .SECONDEXPANSION: 174 180 foo.o: foo.c 175 181 foo.c: ; @echo $@ … … 187 193 # 188 194 run_make_test(' 195 .SECONDEXPANSION: 189 196 foobarbaz: 190 197 … … 205 212 # 206 213 run_make_test(' 214 .SECONDEXPANSION: 207 215 foo$$bar: 208 216 -
trunk/src/gmake/tests/scripts/features/se_statpat
r282 r503 7 7 # 8 8 run_make_test(' 9 .SECONDEXPANSION: 9 10 .DEFAULT: ; @echo $@ 10 11 … … 42 43 # 43 44 run_make_test(' 45 .SECONDEXPANSION: 44 46 .DEFAULT: ; @echo $@ 45 47 … … 61 63 # 62 64 run_make_test(' 65 .SECONDEXPANSION: 63 66 .DEFAULT: ; @echo $@ 64 67 … … 107 110 # 108 111 run_make_test(' 112 .SECONDEXPANSION: 109 113 foo$$bar: f%r: % $$*.1 110 114 @echo \'$*\' -
trunk/src/gmake/tests/scripts/features/statipattrules
r285 r503 10 10 to emacs a .el file"; 11 11 12 open(MAKEFILE,"> $makefile"); 13 print MAKEFILE <<'EOF'; 12 &touch('bar.c', 'lose.c'); 13 14 # TEST #0 15 # ------- 16 17 run_make_test(' 14 18 files = foo.elc bar.o lose.o 15 19 … … 17 21 18 22 $(filter %.elc,$(files)): %.elc: %.el ; @echo emacs $< 19 EOF 20 close(MAKEFILE); 23 ', 24 '', 25 'CC -c bar.c -o bar.o'); 26 27 # TEST #1 28 # ------- 29 30 run_make_test(undef, 'lose.o', 'CC -c lose.c -o lose.o'); 21 31 22 32 23 &touch('bar.c', 'lose.c'); 24 25 # TEST #1 26 # ------- 27 28 &run_make_with_options($makefile, '', &get_logfile); 29 $answer = "CC -c bar.c -o bar.o\n"; 30 &compare_output($answer, &get_logfile(1)); 31 32 33 # TEST #2 34 # ------- 35 36 &run_make_with_options($makefile, 'lose.o', &get_logfile); 37 $answer = "CC -c lose.c -o lose.o\n"; 38 &compare_output($answer, &get_logfile(1)); 39 40 41 # TEST #3 33 # TEST #2 42 34 # ------- 43 35 &touch("foo.el"); 44 36 45 &run_make_with_options($makefile, 'foo.elc', &get_logfile); 46 $answer = "emacs foo.el\n"; 47 &compare_output($answer, &get_logfile(1)); 37 run_make_test(undef, 'foo.elc', 'emacs foo.el'); 48 38 49 39 # Clean up after the first tests. 50 40 unlink('foo.el', 'bar.c', 'lose.c'); 51 41 52 42 53 # TEST # 4-- PR/1670: don't core dump on invalid static pattern rules43 # TEST #3 -- PR/1670: don't core dump on invalid static pattern rules 54 44 # ------- 55 45 56 $makefile2 = &get_tmpfile; 57 open(MAKEFILE, "> $makefile2"); 58 print MAKEFILE "foo: foo%: % ; \@echo \$@\n"; 59 close(MAKEFILE); 46 run_make_test(' 47 .DEFAULT: ; @echo $@ 48 foo: foo%: % %.x % % % y.% % ; @echo $@ 49 ', 50 '', ".x\ny.\nfoo"); 60 51 61 &run_make_with_options($makefile2, '', &get_logfile);62 $answer = "foo\n";63 &compare_output($answer, &get_logfile(1));64 52 65 # TEST # 5-- bug #12180: core dump on a stat pattern rule with an empty53 # TEST #4 -- bug #12180: core dump on a stat pattern rule with an empty 66 54 # prerequisite list. 67 #68 55 run_make_test(' 69 56 foo.x bar.x: %.x : ; @echo $@ 70 57 71 58 ', 59 '', 'foo.x'); 60 61 62 # TEST #5 -- bug #13881: double colon static pattern rule does not 63 # substitute %. 64 run_make_test(' 65 foo.bar:: %.bar: %.baz 66 foo.baz: ;@: 67 ', 68 '', ''); 69 70 71 # TEST #6: make sure the second stem does not overwrite the first 72 # perprerequisite's stem (Savannah bug #16053). 73 # 74 run_make_test(' 75 all.foo.bar: %.foo.bar: %.one 76 77 all.foo.bar: %.bar: %.two 78 79 all.foo.bar: 80 @echo $* 81 @echo $^ 82 83 .DEFAULT:;@: 84 ', 72 85 '', 73 'foo.x 74 '); 86 'all.foo 87 all.one all.foo.two'); 88 89 90 # TEST #7: make sure the second stem does not overwrite the first 91 # perprerequisite's stem when second expansion is enabled 92 # (Savannah bug #16053). 93 # 94 run_make_test(' 95 .SECONDEXPANSION: 96 97 all.foo.bar: %.foo.bar: %.one $$*-one 98 99 all.foo.bar: %.bar: %.two $$*-two 100 101 all.foo.bar: 102 @echo $* 103 @echo $^ 104 105 .DEFAULT:;@: 106 ', 107 '', 108 'all.foo 109 all.one all-one all.foo.two all.foo-two'); 75 110 76 111 1; -
trunk/src/gmake/tests/scripts/features/targetvars
r53 r503 268 268 &compare_output($answer, &get_logfile(1)); 269 269 270 # TEST #17 271 272 # Test a merge of set_lists for files, where one list is much longer 273 # than the other. See Savannah bug #15757. 274 275 mkdir('t1', 0777); 276 touch('t1/rules.mk'); 277 278 run_make_test(' 279 VPATH = t1 280 include rules.mk 281 .PHONY: all 282 all: foo.x 283 foo.x : rules.mk ; @echo MYVAR=$(MYVAR) FOOVAR=$(FOOVAR) ALLVAR=$(ALLVAR) 284 all: ALLVAR = xxx 285 foo.x: FOOVAR = bar 286 rules.mk : MYVAR = foo 287 .INTERMEDIATE: foo.x rules.mk 288 ', 289 '-I t1', 290 'MYVAR= FOOVAR=bar ALLVAR=xxx'); 291 292 rmfiles('t1/rules.mk'); 293 rmdir('t1'); 294 295 # TEST #18 296 297 # Test appending to a simple variable containing a "$": avoid a 298 # double-expansion. See Savannah bug #15913. 299 300 run_make_test(" 301 VAR := \$\$FOO 302 foo: VAR += BAR 303 foo: ; \@echo '\$(VAR)'", 304 '', 305 '$FOO BAR'); 306 270 307 1; -
trunk/src/gmake/tests/scripts/functions/abspath
r282 r503 6 6 run_make_test(' 7 7 ifneq ($(realpath $(abspath .)),$(CURDIR)) 8 $( error)8 $(warning .: abs="$(abspath .)" real="$(realpath $(abspath .))" curdir="$(CURDIR)") 9 9 endif 10 10 11 11 ifneq ($(realpath $(abspath ./)),$(CURDIR)) 12 $( error)12 $(warning ./: abs="$(abspath ./)" real="$(realpath $(abspath ./))" curdir="$(CURDIR)") 13 13 endif 14 14 15 15 ifneq ($(realpath $(abspath .///)),$(CURDIR)) 16 $( error)16 $(warning .///: abs="$(abspath .///)" real="$(realpath $(abspath .///))" curdir="$(CURDIR)") 17 17 endif 18 18 19 19 ifneq ($(abspath /),/) 20 $( error)20 $(warning /: abspath="$(abspath /)") 21 21 endif 22 22 23 23 ifneq ($(abspath ///),/) 24 $( error)24 $(warning ///: abspath="$(abspath ///)") 25 25 endif 26 26 27 27 ifneq ($(abspath /.),/) 28 $( error)28 $(warning /.: abspath="$(abspath /.)") 29 29 endif 30 30 31 31 ifneq ($(abspath ///.),/) 32 $( error)32 $(warning ///.: abspath="$(abspath ///.)") 33 33 endif 34 34 35 35 ifneq ($(abspath /./),/) 36 $( error)36 $(warning /./: abspath="$(abspath /./)") 37 37 endif 38 38 39 39 ifneq ($(abspath /.///),/) 40 $( error)40 $(warning /.///: abspath="$(abspath /.///)") 41 41 endif 42 42 43 43 ifneq ($(abspath /..),/) 44 $( error)44 $(warning /..: abspath="$(abspath /..)") 45 45 endif 46 46 47 47 ifneq ($(abspath ///..),/) 48 $( error)48 $(warning ///..: abspath="$(abspath ///..)") 49 49 endif 50 50 51 51 ifneq ($(abspath /../),/) 52 $( error)52 $(warning /../: abspath="$(abspath /../)") 53 53 endif 54 54 55 55 ifneq ($(abspath /..///),/) 56 $( error)56 $(warning /..///: abspath="$(abspath /..///)") 57 57 endif 58 58 59 59 60 60 ifneq ($(abspath /foo/bar/..),/foo) 61 $( error)61 $(warning /foo/bar/..: abspath="$(abspath /foo/bar/..)") 62 62 endif 63 63 64 64 ifneq ($(abspath /foo/bar/../../../baz),/baz) 65 $( error)65 $(warning /foo/bar/../../../baz: abspath="$(abspath /foo/bar/../../../baz)") 66 66 endif 67 67 68 68 ifneq ($(abspath /foo/bar/../ /..),/foo /) 69 $( error)69 $(warning /foo/bar/../ /..: abspath="$(abspath /foo/bar/../ /..)") 70 70 endif 71 71 -
trunk/src/gmake/tests/scripts/functions/error
r53 r503 1 # -*-Perl-*- 2 1 3 $description = "\ 2 4 The following test creates a makefile to test the error function."; … … 6 8 open(MAKEFILE,"> $makefile"); 7 9 8 print MAKEFILE <<'EOF'; 10 print MAKEFILE 'err = $(error Error found!) 11 9 12 ifdef ERROR1 10 13 $(error error is $(ERROR1)) … … 26 29 some: ; @echo Some stuff 27 30 28 EOF 31 testvar: ; @: $(err) 32 '; 29 33 30 34 close(MAKEFILE); … … 33 37 34 38 &run_make_with_options($makefile, "ERROR1=yes", &get_logfile, 512); 35 $answer = "$makefile: 2: *** error is yes. Stop.\n";39 $answer = "$makefile:4: *** error is yes. Stop.\n"; 36 40 &compare_output($answer,&get_logfile(1)); 37 41 … … 39 43 40 44 &run_make_with_options($makefile, "ERROR2=no", &get_logfile, 512); 41 $answer = "$makefile: 6: *** error is no. Stop.\n";45 $answer = "$makefile:8: *** error is no. Stop.\n"; 42 46 &compare_output($answer,&get_logfile(1)); 43 47 … … 45 49 46 50 &run_make_with_options($makefile, "ERROR3=maybe", &get_logfile, 512); 47 $answer = "Some stuff\n$makefile:1 0: *** error is maybe. Stop.\n";51 $answer = "Some stuff\n$makefile:12: *** error is maybe. Stop.\n"; 48 52 &compare_output($answer,&get_logfile(1)); 49 53 … … 51 55 52 56 &run_make_with_options($makefile, "ERROR4=definitely", &get_logfile, 512); 53 $answer = "Some stuff\n$makefile:14: *** error is definitely. Stop.\n"; 57 $answer = "Some stuff\n$makefile:16: *** error is definitely. Stop.\n"; 58 &compare_output($answer,&get_logfile(1)); 59 60 # Test #5 61 62 &run_make_with_options($makefile, "testvar", &get_logfile, 512); 63 $answer = "$makefile:22: *** Error found!. Stop.\n"; 54 64 &compare_output($answer,&get_logfile(1)); 55 65 -
trunk/src/gmake/tests/scripts/functions/eval
r285 r503 128 128 close(MAKEFILE); 129 129 130 $ ENV{EVAR} = '1';130 $extraENV{EVAR} = '1'; 131 131 &run_make_with_options($makefile4, "", &get_logfile); 132 132 $answer = "OK\n"; 133 133 &compare_output($answer,&get_logfile(1)); 134 135 delete $ENV{EVAR};136 134 137 135 … … 152 150 run_make_test(' 153 151 define FOO 154 all: ; @echo he\llo152 all: ; @echo '."'".'he\llo'."'".' 155 153 @echo world 156 154 endef 157 155 $(eval $(FOO)) 158 ', '', 'he llo156 ', '', 'he\llo 159 157 world'); 160 158 -
trunk/src/gmake/tests/scripts/functions/foreach
r53 r503 1 1 # -*-perl-*- 2 # $Id: foreach,v 1.5 2006/03/10 02:20:46 psmith Exp $ 2 3 3 # Updated 6.16.93 variable "MAKE" is default was environment override 4 # For make 3.63 and above 5 6 $description = "The following test creates a makefile to verify 7 test the foreach function."; 4 $description = "Test the foreach function."; 8 5 9 6 $details = "This is a test of the foreach function in gnu make. … … 15 12 16 13 17 open(MAKEFILE,"> $makefile"); 14 # TEST 0 18 15 19 # The Contents of the MAKEFILE ... 16 # Set an environment variable that we can test in the makefile. 17 $extraENV{FOOFOO} = 'foo foo'; 20 18 21 # On WIN32 systems, the user's path is found in %Path% ($Path) 22 # 23 $pathvar = (($port_type eq 'Windows') ? "Path" : "PATH"); 19 run_make_test("space = ' '".' 20 null := 21 auto_var = udef space CC null FOOFOO MAKE foo CFLAGS WHITE @ < 22 foo = bletch null @ garf 23 av = $(foreach var, $(auto_var), $(origin $(var)) ) 24 override WHITE := BLACK 25 for_var = $(addsuffix .c,foo $(null) $(foo) $(space) $(av) ) 26 fe = $(foreach var2, $(for_var),$(subst .c,.o, $(var2) ) ) 27 all: auto for2 28 auto : ; @echo $(av) 29 for2: ; @echo $(fe)', 30 '-e WHITE=WHITE CFLAGS=', 31 "undefined file default file environment default file command line override automatic automatic 32 foo.o bletch.o null.o @.o garf.o .o .o undefined.o file.o default.o file.o environment.o default.o file.o command.o line.o override.o automatic.o automatic.o"); 24 33 25 print MAKEFILE <<EOF; 26 foo = bletch null \@ garf 27 null := 28 space = ' ' 29 auto_var = udef space CC null $pathvar MAKE foo CFLAGS WHITE \@ < 30 av = \$(foreach var, \$(auto_var), \$(origin \$(var)) ) 31 override WHITE := BLACK 32 for_var = \$(addsuffix .c,foo \$(null) \$(foo) \$(space) \$(av) ) 33 fe = \$(foreach var2, \$(for_var),\$(subst .c,.o, \$(var2) ) ) 34 all: auto for2 35 auto : 36 \t\@echo \$(av) 37 for2: 38 \t\@echo \$(fe) 39 EOF 34 delete $extraENV{FOOFOO}; 40 35 41 close(MAKEFILE); 36 # TEST 1: Test that foreach variables take precedence over global 37 # variables in a global scope (like inside an eval). Tests bug #11913 42 38 43 &run_make_with_options($makefile, 44 "-e WHITE=WHITE CFLAGS=", 45 &get_logfile); 39 run_make_test(' 40 .PHONY: all target 41 all: target 46 42 47 # Create the answer to what should be produced by this Makefile 48 $answer = "undefined file default file environment default file command line override automatic automatic 49 foo.o bletch.o null.o @.o garf.o .o .o undefined.o file.o default.o file.o environment.o default.o file.o command.o line.o override.o automatic.o automatic.o\n"; 43 x := BAD 50 44 51 &compare_output($answer,&get_logfile(1)); 45 define mktarget 46 target: x := $(x) 47 target: ; @echo "$(x)" 48 endef 49 50 x := GLOBAL 51 52 $(foreach x,FOREACH,$(eval $(value mktarget)))', 53 '', 54 'FOREACH'); 55 56 57 # TEST 2: Check some error conditions. 58 59 run_make_test(' 60 x = $(foreach ) 61 y = $x 62 63 all: ; @echo $y', 64 '', 65 "#MAKEFILE#:2: *** insufficient number of arguments (1) to function `foreach'. Stop.", 66 512); 67 68 run_make_test(' 69 x = $(foreach ) 70 y := $x 71 72 all: ; @echo $y', 73 '', 74 "#MAKEFILE#:2: *** insufficient number of arguments (1) to function `foreach'. Stop.", 75 512); 52 76 53 77 1; -
trunk/src/gmake/tests/scripts/functions/origin
r154 r503 17 17 18 18 # Set an environment variable 19 $ ENV{MAKETEST} = 1;19 $extraENV{MAKETEST} = 1; 20 20 21 open(MAKEFILE,"> $makefile"); 22 23 print MAKEFILE <<EOF; 21 run_make_test(' 24 22 foo := bletch garf 25 auto_var = u def CC MAKETEST MAKE foo CFLAGS WHITE \@26 av = \$(foreach var, \$(auto_var), \$(origin \$(var)) )23 auto_var = undefined CC MAKETEST MAKE foo CFLAGS WHITE @ 24 av = $(foreach var, $(auto_var), $(origin $(var)) ) 27 25 override WHITE := BLACK 28 26 all: auto 29 \t\@echo \$(origin undefined)30 \t\@echo \$(origin CC)31 \t\@echo \$(origin MAKETEST)32 \t\@echo \$(origin MAKE)33 \t\@echo \$(origin foo)34 \t\@echo \$(origin CFLAGS)35 \t\@echo \$(origin WHITE)36 \t\@echo \$(origin \@)27 @echo $(origin undefined) 28 @echo $(origin CC) 29 @echo $(origin MAKETEST) 30 @echo $(origin MAKE) 31 @echo $(origin foo) 32 @echo $(origin CFLAGS) 33 @echo $(origin WHITE) 34 @echo $(origin @) 37 35 auto : 38 \t\@echo \$(av) 39 EOF 40 41 close(MAKEFILE); 42 43 &run_make_with_options($makefile, 44 "-e WHITE=WHITE CFLAGS=", 45 &get_logfile); 46 47 # Create the answer to what should be produced by this Makefile 48 $answer = "undefined default environment default file command line override automatic 36 @echo $(av)', 37 '-e WHITE=WHITE CFLAGS=', 38 'undefined default environment default file command line override automatic 49 39 undefined 50 40 default … … 54 44 command line 55 45 override 56 automatic \n";46 automatic'); 57 47 58 59 &compare_output($answer,&get_logfile(1));48 # Reset an environment variable 49 delete $extraENV{MAKETEST}; 60 50 61 51 1; -
trunk/src/gmake/tests/scripts/functions/realpath
r282 r503 21 21 endif 22 22 23 ifneq ($(realpath ///),/)24 $(error )25 endif26 27 23 ifneq ($(realpath /.),/) 28 $(error )29 endif30 31 ifneq ($(realpath ///.),/)32 24 $(error ) 33 25 endif … … 42 34 43 35 ifneq ($(realpath /..),/) 44 $(error )45 endif46 47 ifneq ($(realpath ///..),/)48 36 $(error ) 49 37 endif … … 64 52 all: ; @: 65 53 ', 66 '', 67 ''); 54 '', 55 ''); 56 57 # On Windows platforms, "//" means something special. So, don't do these 58 # tests there. 59 60 if ($port_type ne 'W32') { 61 run_make_test(' 62 ifneq ($(realpath ///),/) 63 $(error ) 64 endif 65 66 ifneq ($(realpath ///.),/) 67 $(error ) 68 endif 69 70 ifneq ($(realpath ///..),/) 71 $(error ) 72 endif 73 74 .PHONY: all 75 all: ; @:', 76 '', 77 ''); 78 } 68 79 69 80 -
trunk/src/gmake/tests/scripts/functions/warning
r53 r503 1 # -*-Perl-*- 2 1 3 $description = "\ 2 4 The following test creates a makefile to test the warning function."; -
trunk/src/gmake/tests/scripts/functions/wildcard
r285 r503 14 14 the '*' wildcard as in the first test"; 15 15 16 if ($vos)17 {18 $delete_command = "delete_file -no_ask";19 }20 else21 {22 $delete_command = "rm";23 }24 25 26 16 open(MAKEFILE,"> $makefile"); 27 17 … … 30 20 print MAKEFILE <<EOM; 31 21 .PHONY: print1 print2 clean 32 print1: ;\@echo \$( wildcard example.*)22 print1: ;\@echo \$(sort \$(wildcard example.*)) 33 23 print2: 34 \t\@echo \$( wildcard example.?)35 \t\@echo \$( wildcard example.[a-z0-9])36 \t\@echo \$( wildcard example.[!A-Za-z_\\!])24 \t\@echo \$(sort \$(wildcard example.?)) 25 \t\@echo \$(sort \$(wildcard example.[a-z0-9])) 26 \t\@echo \$(sort \$(wildcard example.[!A-Za-z_\\!])) 37 27 clean: 38 \t$delete_command \$( wildcard example.*)28 \t$delete_command \$(sort \$(wildcard example.*)) 39 29 EOM 40 30 -
trunk/src/gmake/tests/scripts/functions/word
r285 r503 47 47 # Test error conditions 48 48 49 $makefile2 = &get_tmpfile; 50 51 open(MAKEFILE, "> $makefile2"); 52 print MAKEFILE <<'EOF'; 53 FOO = foo bar biz baz 49 run_make_test('FOO = foo bar biz baz 54 50 55 51 word-e1: ; @echo $(word ,$(FOO)) … … 59 55 wordlist-e1: ; @echo $(wordlist ,,$(FOO)) 60 56 wordlist-e2: ; @echo $(wordlist abc ,,$(FOO)) 61 wordlist-e3: ; @echo $(wordlist 1, 12a ,$(FOO)) 57 wordlist-e3: ; @echo $(wordlist 1, 12a ,$(FOO))', 58 'word-e1', 59 "#MAKEFILE#:3: *** non-numeric first argument to `word' function: ''. Stop.", 60 512); 62 61 63 EOF 62 run_make_test(undef, 63 'word-e2', 64 "#MAKEFILE#:4: *** non-numeric first argument to `word' function: 'abc '. Stop.", 65 512); 64 66 65 close(MAKEFILE); 67 run_make_test(undef, 68 'word-e3', 69 "#MAKEFILE#:5: *** non-numeric first argument to `word' function: '1a'. Stop.", 70 512); 66 71 67 &run_make_with_options($makefile2, 'word-e1', &get_logfile, 512); 68 $answer = "$makefile2:3: *** non-numeric first argument to `word' function: ''. Stop.\n"; 69 &compare_output($answer, &get_logfile(1)); 72 run_make_test(undef, 73 'wordlist-e1', 74 "#MAKEFILE#:7: *** non-numeric first argument to `wordlist' function: ''. Stop.", 75 512); 70 76 71 &run_make_with_options($makefile2, 'word-e2', &get_logfile, 512); 72 $answer = "$makefile2:4: *** non-numeric first argument to `word' function: 'abc '. Stop.\n"; 73 &compare_output($answer, &get_logfile(1)); 77 run_make_test(undef, 78 'wordlist-e2', 79 "#MAKEFILE#:8: *** non-numeric first argument to `wordlist' function: 'abc '. Stop.", 80 512); 74 81 75 &run_make_with_options($makefile2, 'word-e3', &get_logfile, 512); 76 $answer = "$makefile2:5: *** non-numeric first argument to `word' function: '1a'. Stop.\n"; 77 &compare_output($answer, &get_logfile(1)); 82 run_make_test(undef, 83 'wordlist-e3', 84 "#MAKEFILE#:9: *** non-numeric second argument to `wordlist' function: ' 12a '. Stop.", 85 512); 78 86 79 &run_make_with_options($makefile2, 'wordlist-e1', &get_logfile, 512); 80 $answer = "$makefile2:7: *** non-numeric first argument to `wordlist' function: ''. Stop.\n"; 81 &compare_output($answer, &get_logfile(1)); 87 # Test error conditions again, but this time in a variable reference 82 88 83 &run_make_with_options($makefile2, 'wordlist-e2', &get_logfile, 512); 84 $answer = "$makefile2:8: *** non-numeric first argument to `wordlist' function: 'abc '. Stop.\n"; 85 &compare_output($answer, &get_logfile(1)); 89 run_make_test('FOO = foo bar biz baz 86 90 87 &run_make_with_options($makefile2, 'wordlist-e3', &get_logfile, 512); 88 $answer = "$makefile2:9: *** non-numeric second argument to `wordlist' function: ' 12a '. Stop.\n"; 89 &compare_output($answer, &get_logfile(1)); 91 W = $(word $x,$(FOO)) 92 WL = $(wordlist $s,$e,$(FOO)) 93 94 word-e: ; @echo $(W) 95 wordlist-e: ; @echo $(WL)', 96 'word-e x=', 97 "#MAKEFILE#:3: *** non-numeric first argument to `word' function: ''. Stop.", 98 512); 99 100 run_make_test(undef, 101 'word-e x=abc', 102 "#MAKEFILE#:3: *** non-numeric first argument to `word' function: 'abc'. Stop.", 103 512); 104 105 run_make_test(undef, 106 'word-e x=0', 107 "#MAKEFILE#:3: *** first argument to `word' function must be greater than 0. Stop.", 108 512); 109 110 run_make_test(undef, 111 'wordlist-e s= e=', 112 "#MAKEFILE#:4: *** non-numeric first argument to `wordlist' function: ''. Stop.", 113 512); 114 115 run_make_test(undef, 116 'wordlist-e s=abc e=', 117 "#MAKEFILE#:4: *** non-numeric first argument to `wordlist' function: 'abc'. Stop.", 118 512); 119 120 run_make_test(undef, 121 'wordlist-e s=4 e=12a', 122 "#MAKEFILE#:4: *** non-numeric second argument to `wordlist' function: '12a'. Stop.", 123 512); 124 125 run_make_test(undef, 126 'wordlist-e s=0 e=12', 127 "#MAKEFILE#:4: *** invalid first argument to `wordlist' function: `0'. Stop.", 128 512); 90 129 91 130 -
trunk/src/gmake/tests/scripts/misc/general3
r53 r503 6 6 break."; 7 7 8 $makefile2 = &get_tmpfile; 9 10 open(MAKEFILE,"> $makefile"); 11 12 # The contents of the Makefile ... 13 14 print MAKEFILE <<EOF; 8 run_make_test(" 15 9 # We want to allow both empty commands _and_ commands that resolve to empty. 16 10 EMPTY = … … 32 26 \$(STR) 33 27 34 \$(STR) \$(TAB) 35 36 EOF 37 38 close(MAKEFILE); 39 40 &run_make_with_options($makefile,"",&get_logfile); 41 $answer = "$make_name: Nothing to be done for `all'.\n"; 42 &compare_output($answer,&get_logfile(1)); 43 28 \$(STR) \$(TAB)", 29 '', "#MAKE#: Nothing to be done for `all'."); 44 30 45 31 # TEST 2 46 32 47 33 # Make sure files without trailing newlines are handled properly. 34 # Have to use the old style invocation to test this. 35 36 $makefile2 = &get_tmpfile; 48 37 49 38 open(MAKEFILE, "> $makefile2"); … … 55 44 &compare_output($answer,&get_logfile(1)); 56 45 46 # TEST 3 47 48 # Check semicolons in variable references 49 50 run_make_test(' 51 $(if true,$(info true; true)) 52 all: ; @: 53 ', 54 '', 'true; true'); 55 56 # TEST 4 57 58 # Check that backslashes in command scripts are handled according to POSIX. 59 # Checks Savannah bug # 1332. 60 61 # Test the fastpath / no quotes 62 run_make_test(' 63 all: 64 @echo foo\ 65 bar 66 @echo foo\ 67 bar 68 @echo foo\ 69 bar 70 @echo foo\ 71 bar 72 @echo foo \ 73 bar 74 @echo foo \ 75 bar 76 @echo foo \ 77 bar 78 @echo foo \ 79 bar 80 ', 81 '', 'foobar 82 foobar 83 foo bar 84 foo bar 85 foo bar 86 foo bar 87 foo bar 88 foo bar'); 89 90 # Test the fastpath / single quotes 91 run_make_test(" 92 all: 93 \@echo 'foo\\ 94 bar' 95 \@echo 'foo\\ 96 bar' 97 \@echo 'foo\\ 98 bar' 99 \@echo 'foo\\ 100 bar' 101 \@echo 'foo \\ 102 bar' 103 \@echo 'foo \\ 104 bar' 105 \@echo 'foo \\ 106 bar' 107 \@echo 'foo \\ 108 bar' 109 ", 110 '', 'foo\ 111 bar 112 foo\ 113 bar 114 foo\ 115 bar 116 foo\ 117 bar 118 foo \ 119 bar 120 foo \ 121 bar 122 foo \ 123 bar 124 foo \ 125 bar'); 126 127 # Test the fastpath / double quotes 128 run_make_test(' 129 all: 130 @echo "foo\ 131 bar" 132 @echo "foo\ 133 bar" 134 @echo "foo\ 135 bar" 136 @echo "foo\ 137 bar" 138 @echo "foo \ 139 bar" 140 @echo "foo \ 141 bar" 142 @echo "foo \ 143 bar" 144 @echo "foo \ 145 bar" 146 ', 147 '', 'foobar 148 foobar 149 foo bar 150 foo bar 151 foo bar 152 foo bar 153 foo bar 154 foo bar'); 155 156 # Test the slow path / no quotes 157 run_make_test(' 158 all: 159 @echo hi; echo foo\ 160 bar 161 @echo hi; echo foo\ 162 bar 163 @echo hi; echo foo\ 164 bar 165 @echo hi; echo foo\ 166 bar 167 @echo hi; echo foo \ 168 bar 169 @echo hi; echo foo \ 170 bar 171 @echo hi; echo foo \ 172 bar 173 @echo hi; echo foo \ 174 bar 175 ', 176 '', 'hi 177 foobar 178 hi 179 foobar 180 hi 181 foo bar 182 hi 183 foo bar 184 hi 185 foo bar 186 hi 187 foo bar 188 hi 189 foo bar 190 hi 191 foo bar'); 192 193 # Test the slow path / no quotes. This time we put the slow path 194 # determination _after_ the backslash-newline handling. 195 run_make_test(' 196 all: 197 @echo foo\ 198 bar; echo hi 199 @echo foo\ 200 bar; echo hi 201 @echo foo\ 202 bar; echo hi 203 @echo foo\ 204 bar; echo hi 205 @echo foo \ 206 bar; echo hi 207 @echo foo \ 208 bar; echo hi 209 @echo foo \ 210 bar; echo hi 211 @echo foo \ 212 bar; echo hi 213 ', 214 '', 'foobar 215 hi 216 foobar 217 hi 218 foo bar 219 hi 220 foo bar 221 hi 222 foo bar 223 hi 224 foo bar 225 hi 226 foo bar 227 hi 228 foo bar 229 hi'); 230 231 # Test the slow path / single quotes 232 run_make_test(" 233 all: 234 \@echo hi; echo 'foo\\ 235 bar' 236 \@echo hi; echo 'foo\\ 237 bar' 238 \@echo hi; echo 'foo\\ 239 bar' 240 \@echo hi; echo 'foo\\ 241 bar' 242 \@echo hi; echo 'foo \\ 243 bar' 244 \@echo hi; echo 'foo \\ 245 bar' 246 \@echo hi; echo 'foo \\ 247 bar' 248 \@echo hi; echo 'foo \\ 249 bar' 250 ", 251 '', 'hi 252 foo\ 253 bar 254 hi 255 foo\ 256 bar 257 hi 258 foo\ 259 bar 260 hi 261 foo\ 262 bar 263 hi 264 foo \ 265 bar 266 hi 267 foo \ 268 bar 269 hi 270 foo \ 271 bar 272 hi 273 foo \ 274 bar'); 275 276 # Test the slow path / double quotes 277 run_make_test(' 278 all: 279 @echo hi; echo "foo\ 280 bar" 281 @echo hi; echo "foo\ 282 bar" 283 @echo hi; echo "foo\ 284 bar" 285 @echo hi; echo "foo\ 286 bar" 287 @echo hi; echo "foo \ 288 bar" 289 @echo hi; echo "foo \ 290 bar" 291 @echo hi; echo "foo \ 292 bar" 293 @echo hi; echo "foo \ 294 bar" 295 ', 296 '', 'hi 297 foobar 298 hi 299 foobar 300 hi 301 foo bar 302 hi 303 foo bar 304 hi 305 foo bar 306 hi 307 foo bar 308 hi 309 foo bar 310 hi 311 foo bar'); 57 312 58 313 1; -
trunk/src/gmake/tests/scripts/misc/general4
r285 r503 6 6 break."; 7 7 8 open(MAKEFILE,"> $makefile"); 9 print MAKEFILE <<'EOF'; 8 run_make_test(' 10 9 # Make sure that subdirectories built as prerequisites are actually handled 11 10 # properly. … … 17 16 dir/subdir/file.b: dir/subdir ; @echo touch dir/subdir/file.b 18 17 19 dir/subdir/%.a: dir/subdir/%.b ; @echo cp $< $@ 20 EOF 21 close(MAKEFILE); 22 23 &run_make_with_options($makefile,"",&get_logfile); 24 $answer = "mkdir -p dir/subdir\ntouch dir/subdir/file.b\ncp dir/subdir/file.b dir/subdir/file.a\n"; 25 &compare_output($answer,&get_logfile(1)); 18 dir/subdir/%.a: dir/subdir/%.b ; @echo cp $< $@', 19 '', "mkdir -p dir/subdir\ntouch dir/subdir/file.b\ncp dir/subdir/file.b dir/subdir/file.a\n"); 26 20 27 21 # Test implicit rules … … 48 42 unlink('bar'); 49 43 44 45 # Test implicit rules with '$' in the name (see se_implicit) 46 47 run_make_test(q! 48 %.foo : baz$$bar ; @echo 'done $<' 49 %.foo : bar$$baz ; @echo 'done $<' 50 test.foo: 51 baz$$bar bar$$baz: ; @echo '$@' 52 !, 53 '', 54 "baz\$bar\ndone baz\$bar"); 55 56 57 # Test implicit rules with '$' in the name (see se_implicit) 58 # Use the '$' in the pattern. 59 60 run_make_test(q! 61 %.foo : %$$bar ; @echo 'done $<' 62 test.foo: 63 test$$bar: ; @echo '$@' 64 !, 65 '', 66 "test\$bar\ndone test\$bar"); 67 68 # Make sure that subdirectories built as prerequisites are actually handled 69 # properly... this time with '$' 70 71 run_make_test(q! 72 73 all: dir/subdir/file.$$a 74 75 dir/subdir: ; @echo mkdir -p '$@' 76 77 dir/subdir/file.$$b: dir/subdir ; @echo touch '$@' 78 79 dir/subdir/%.$$a: dir/subdir/%.$$b ; @echo 'cp $< $@' 80 !, 81 '', "mkdir -p dir/subdir\ntouch dir/subdir/file.\$b\ncp dir/subdir/file.\$b dir/subdir/file.\$a\n"); 82 50 83 1; -
trunk/src/gmake/tests/scripts/options/dash-B
r285 r503 32 32 run_make_test(undef, '-B', 'cp bar.x foo'); 33 33 34 35 34 # Clean up 36 35 37 36 rmfiles('bar.x', 'foo'); 38 37 38 # Test -B with the re-exec feature: we don't want to re-exec forever 39 # Savannah bug # 7566 40 41 run_make_test(' 42 all: ; @: 43 $(info MAKE_RESTARTS=$(MAKE_RESTARTS)) 44 include foo.x 45 foo.x: ; @touch $@ 46 ', 47 '-B', 'MAKE_RESTARTS= 48 #MAKEFILE#:4: foo.x: No such file or directory 49 MAKE_RESTARTS=1'); 50 51 rmfiles('foo.x'); 52 53 # Test -B with the re-exec feature: we DO want -B in the "normal" part of the 54 # makefile. 55 56 &touch('blah.x'); 57 58 run_make_test(' 59 all: blah.x ; @echo $@ 60 $(info MAKE_RESTARTS=$(MAKE_RESTARTS)) 61 include foo.x 62 foo.x: ; @touch $@ 63 blah.x: ; @echo $@ 64 ', 65 '-B', 'MAKE_RESTARTS= 66 #MAKEFILE#:4: foo.x: No such file or directory 67 MAKE_RESTARTS=1 68 blah.x 69 all'); 70 71 rmfiles('foo.x', 'blah.x'); 72 39 73 1; -
trunk/src/gmake/tests/scripts/options/dash-I
r53 r503 1 # -*-perl-*- 2 1 3 $description ="The following test creates a makefile to test the -I option."; 2 4 -
trunk/src/gmake/tests/scripts/options/dash-e
r53 r503 5 5 $details = ""; 6 6 7 $ ENV{GOOGLE} = 'boggle';7 $extraENV{GOOGLE} = 'boggle'; 8 8 9 9 open(MAKEFILE,"> $makefile"); -
trunk/src/gmake/tests/scripts/options/symlinks
r282 r503 6 6 7 7 # Only run these tests if the system sypports symlinks 8 if (eval { symlink("",""); 1 }) { 8 9 # Apparently the Windows port of Perl reports that it does support symlinks 10 # (in that the symlink() function doesn't fail) but it really doesn't, so 11 # check for it explicitly. 12 13 if ($port_type eq 'W32' || !( eval { symlink("",""); 1 })) { 14 # This test is N/A 15 -1; 16 } else { 9 17 10 18 # Set up a symlink sym -> dep … … 43 51 44 52 rmfiles('targ', 'dep', 'sym', 'dep1'); 53 54 # Check handling when symlinks point to non-existent files. Without -L we 55 # should get an error: with -L we should use the timestamp of the symlink. 56 57 symlink("../$dirname/dep", 'sym'); 58 run_make_test('targ: sym ; @echo make $@ from $<', '', 59 "#MAKE#: *** No rule to make target `sym', needed by `targ'. Stop.", 512); 60 61 run_make_test('targ: sym ; @echo make $@ from $<', '-L', 62 'make targ from sym'); 63 64 65 rmfiles('targ', 'sym'); 66 67 1; 45 68 } 46 47 1; -
trunk/src/gmake/tests/scripts/targets/FORCE
r285 r503 1 # -*-perl-*- 2 1 3 $description = "The following tests rules without Commands or Dependencies."; 2 4 3 5 $details = "If the rule ...\n"; 4 5 if ($vos)6 {7 $delete_command = "delete_file";8 }9 else10 {11 $delete_command = "rm";12 }13 6 14 7 open(MAKEFILE,"> $makefile"); -
trunk/src/gmake/tests/scripts/targets/PHONY
r285 r503 1 # -*-perl-*- 2 1 3 $description = "The following tests the use of a PHONY target. It makes\n" 2 4 ."sure that the rules under a target get executed even if\n" … … 8 10 ."directory. Although this file exists, the rule under the target\n" 9 11 ."clean should still execute because of it's phony status."; 10 11 if ($vos)12 {13 $delete_command = "delete_file";14 }15 else16 {17 $delete_command = "rm";18 }19 12 20 13 $example = "EXAMPLE_FILE"; -
trunk/src/gmake/tests/scripts/targets/SILENT
r285 r503 1 # -*-perl-*- 2 1 3 $description = "The following tests the special target .SILENT. By simply\n" 2 4 ."mentioning this as a target, it tells make not to print\n" … … 5 7 $details = "This test is the same as the clean test except that it should\n" 6 8 ."not echo its command before deleting the specified file.\n"; 7 8 if ($vos)9 {10 $delete_command = "delete_file";11 }12 else13 {14 $delete_command = "rm";15 }16 9 17 10 $example = "EXAMPLE_FILE"; -
trunk/src/gmake/tests/scripts/variables/SHELL
r282 r503 5 5 # Find the default value when SHELL is not set. On UNIX it will be /bin/sh, 6 6 # but on other platforms who knows? 7 $oshell = $ENV{SHELL};7 resetENV(); 8 8 delete $ENV{SHELL}; 9 $mshell = `echo 'all:;\@echo \$(SHELL)' | $make_ name-f-`;9 $mshell = `echo 'all:;\@echo \$(SHELL)' | $make_path -f-`; 10 10 chop $mshell; 11 11 12 12 # According to POSIX, the value of SHELL in the environment has no impact on 13 13 # the value in the makefile. 14 # Note %extraENV takes precedence over the default value for the shell. 14 15 15 $ ENV{SHELL} = '/dev/null';16 $extraENV{SHELL} = '/dev/null'; 16 17 run_make_test('all:;@echo "$(SHELL)"', '', $mshell); 17 18 … … 19 20 # exported to the subshell! I wanted to set SHELL to be $^X (perl) in the 20 21 # makefile, but make runs $(SHELL) -c 'commandline' and that doesn't work at 21 # all when $(SHELL) is perl :-/. So, we just add an extra initial / and hope22 # for the best on non-UNIX platforms :-/.22 # all when $(SHELL) is perl :-/. So, we just add an extra initial /./ which 23 # works well on UNIX and seems to work OK on at least some non-UNIX systems. 23 24 24 $ ENV{SHELL} = $mshell;25 $extraENV{SHELL} = $mshell; 25 26 26 run_make_test("SHELL := / $mshell\n".'27 run_make_test("SHELL := /./$mshell\n".' 27 28 all:;@echo "$(SHELL) $$SHELL" 28 ', '', "/ $mshell $mshell");29 ', '', "/./$mshell $mshell"); 29 30 30 31 # As a GNU make extension, if make's SHELL variable is explicitly exported, 31 32 # then we really _DO_ export it. 32 33 33 run_make_test("export SHELL := /$mshell\n".' 34 $extraENV{SHELL} = $mshell; 35 36 run_make_test("export SHELL := /./$mshell\n".' 34 37 all:;@echo "$(SHELL) $$SHELL" 35 ', '', "/ $mshell/$mshell");38 ', '', "/./$mshell /./$mshell"); 36 39 37 40 … … 39 42 # variable. 40 43 41 run_make_test("all: SHELL := /$mshell\n".' 44 $extraENV{SHELL} = $mshell; 45 46 run_make_test("all: SHELL := /./$mshell\n".' 42 47 all:;@echo "$(SHELL) $$SHELL" 43 ', '', "/ $mshell $mshell");48 ', '', "/./$mshell $mshell"); 44 49 45 run_make_test("all: export SHELL := /$mshell\n".' 50 $extraENV{SHELL} = $mshell; 51 52 run_make_test("all: export SHELL := /./$mshell\n".' 46 53 all:;@echo "$(SHELL) $$SHELL" 47 ', '', "/ $mshell $mshell");54 ', '', "/./$mshell $mshell"); 48 55 49 56 1; -
trunk/src/gmake/tests/scripts/variables/automatic
r285 r503 28 28 close(MAKEFILE); 29 29 30 # TEST # 1-- simple test30 # TEST #0 -- simple test 31 31 # ------- 32 32 … … 47 47 unlink(qw(foo.x bar.y baz.z)); 48 48 49 # TEST # 2-- test the SysV emulation of $$@ etc.49 # TEST #1 -- test the SysV emulation of $$@ etc. 50 50 # ------- 51 51 … … 55 55 print MAKEFILE "dir = $dir\n"; 56 56 print MAKEFILE <<'EOF'; 57 .SECONDEXPANSION: 57 58 .SUFFIXES: 58 59 .DEFAULT: ; @echo '$@' … … 79 80 &compare_output($answer, &get_logfile(1)); 80 81 81 # TEST # 3-- test for Savannah bug #12320.82 # TEST #2 -- test for Savannah bug #12320. 82 83 # 83 84 run_make_test(' … … 87 88 @echo $* 88 89 89 mbr.src: ; @: 90 mbr.src: ; @:', 91 '', 92 'mbr'); 90 93 91 ', 92 '', 93 'mbr 94 '); 94 # TEST #3 -- test for Savannah bug #8154 95 # Make sure that nonexistent prerequisites are listed in $?, since they are 96 # considered reasons for the target to be rebuilt. 97 # 98 # This was undone due to Savannah bug #16002. We'll re-do it in the next 99 # release. See Savannah bug #16051. 100 101 #touch('foo'); 102 # 103 #run_make_test(' 104 #foo: bar ; @echo "\$$? = $?" 105 #bar: ;', 106 # '', 107 # '$? = bar'); 108 # 109 #unlink('foo'); 95 110 96 111 1; -
trunk/src/gmake/tests/test_driver.pl
r281 r503 1 1 #!/usr/bin/perl 2 2 # -*-perl-*- 3 3 # 4 4 # Modification history: 5 5 # Written 91-12-02 through 92-01-01 by Stephen McGee. 6 6 # Modified 92-02-11 through 92-02-22 by Chris Arthur to further generalize. 7 # End of modification history 7 # 8 # Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 9 # 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 10 # This file is part of GNU Make. 11 # 12 # GNU Make is free software; you can redistribute it and/or modify it under the 13 # terms of the GNU General Public License as published by the Free Software 14 # Foundation; either version 2, or (at your option) any later version. 15 # 16 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 18 # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License along with 21 # GNU Make; see the file COPYING. If not, write to the Free Software 22 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 23 8 24 9 25 # Test driver routines used by a number of test suites, including 10 26 # those for SCS, make, roll_dir, and scan_deps (?). 11 27 # 12 28 # this routine controls the whole mess; each test suite sets up a few 13 29 # variables and then calls &toplevel, which does all the real work. 14 30 15 # $Id: test_driver.pl,v 1.1 4 2005/02/28 07:48:23psmith Exp $31 # $Id: test_driver.pl,v 1.19 2006/03/10 02:20:45 psmith Exp $ 16 32 17 33 … … 33 49 $test_passed = 1; 34 50 51 52 # %makeENV is the cleaned-out environment. 53 %makeENV = (); 54 55 # %extraENV are any extra environment variables the tests might want to set. 56 # These are RESET AFTER EVERY TEST! 57 %extraENV = (); 58 59 # %origENV is the caller's original environment 60 %origENV = %ENV; 61 62 sub resetENV 63 { 64 # We used to say "%ENV = ();" but this doesn't work in Perl 5.000 65 # through Perl 5.004. It was fixed in Perl 5.004_01, but we don't 66 # want to require that here, so just delete each one individually. 67 foreach $v (keys %ENV) { 68 delete $ENV{$v}; 69 } 70 71 %ENV = %makeENV; 72 foreach $v (keys %extraENV) { 73 $ENV{$v} = $extraENV{$v}; 74 delete $extraENV{$v}; 75 } 76 } 77 35 78 sub toplevel 36 79 { 37 # Get a clean environment38 39 %makeENV = ();40 41 80 # Pull in benign variables from the user's environment 42 81 # … … 58 97 %origENV = %ENV; 59 98 60 # We used to say "%ENV = ();" but this doesn't work in Perl 5.000 61 # through Perl 5.004. It was fixed in Perl 5.004_01, but we don't 62 # want to require that here, so just delete each one individually. 63 64 foreach $v (keys %ENV) { 65 delete $ENV{$v}; 66 } 67 68 %ENV = %makeENV; 99 resetENV(); 69 100 70 101 $| = 1; # unbuffered output … … 134 165 opendir (SCRIPTDIR, $scriptpath) 135 166 || &error ("Couldn't opendir $scriptpath: $!\n"); 136 @dirs = grep (!/^(\. \.?|CVS|RCS)$/, readdir (SCRIPTDIR) );167 @dirs = grep (!/^(\..*|CVS|RCS)$/, readdir (SCRIPTDIR) ); 137 168 closedir (SCRIPTDIR); 138 169 foreach $dir (@dirs) 139 170 { 140 next if ($dir =~ /^\.\.?$/ || $dir eq 'CVS' || $dir eq 'RCS' 141 || ! -d "$scriptpath/$dir"); 171 next if ($dir =~ /^(\..*|CVS|RCS)$/ || ! -d "$scriptpath/$dir"); 142 172 push (@rmdirs, $dir); 143 173 mkdir ("$workpath/$dir", 0777) … … 145 175 opendir (SCRIPTDIR, "$scriptpath/$dir") 146 176 || &error ("Couldn't opendir $scriptpath/$dir: $!\n"); 147 @files = grep (!/^(\. \.?|CVS|RCS)$/, readdir (SCRIPTDIR) );177 @files = grep (!/^(\..*|CVS|RCS|.*~)$/, readdir (SCRIPTDIR) ); 148 178 closedir (SCRIPTDIR); 149 179 foreach $test (@files) 150 180 { 151 next if $test =~ /~$/ || -d $test;181 -d $test and next; 152 182 push (@TESTS, "$dir/$test"); 153 183 } … … 398 428 $baseext = 'b'; 399 429 $extext = ''; 400 } 401 else { 430 } else { 402 431 $logext = 'log'; 403 432 $diffext = 'diff'; … … 430 459 { 431 460 $suite_passed = 0; 432 if (length ($@)) 433 { 461 if (length ($@)) { 434 462 warn "\n*** Test died ($testname): $@\n"; 435 } 436 else 437 { 463 } else { 438 464 warn "\n*** Couldn't run $perl_testname\n"; 439 465 } … … 461 487 } 462 488 } 463 elsif ( $code > 0) {489 elsif (!defined $code || $code > 0) { 464 490 $status = "FAILED ($tests_passed/$tests_run passed)"; 465 491 } … … 745 771 local ($code); 746 772 773 # We reset this before every invocation. On Windows I think there is only 774 # one environment, not one per process, so I think that variables set in 775 # test scripts might leak into subsequent tests if this isn't reset--??? 776 resetENV(); 777 747 778 print "\nrun_command: @_\n" if $debug; 748 779 $code = system @_; … … 761 792 local ($filename) = shift; 762 793 local ($code); 794 795 # We reset this before every invocation. On Windows I think there is only 796 # one environment, not one per process, so I think that variables set in 797 # test scripts might leak into subsequent tests if this isn't reset--??? 798 resetENV(); 763 799 764 800 &attach_default_output ($filename);
Note:
See TracChangeset
for help on using the changeset viewer.