Changeset 3138 in kBuild for vendor/gnumake/current/tests
- Timestamp:
- Mar 12, 2018 7:32:29 PM (7 years ago)
- Location:
- vendor/gnumake/current/tests
- Files:
-
- 23 added
- 1 deleted
- 60 edited
- 1 moved
-
.cvsignore (deleted)
-
.gitignore (added)
-
ChangeLog.1 (moved) (moved from vendor/gnumake/current/tests/ChangeLog ) (6 diffs)
-
NEWS (modified) (2 diffs)
-
README (modified) (3 diffs)
-
config-flags.pm.in (added)
-
config_flags_pm.com (added)
-
guile.supp (added)
-
mkshadow (modified) (3 diffs)
-
run_make_tests.com (added)
-
run_make_tests.pl (modified) (16 diffs)
-
scripts/features/archives (added)
-
scripts/features/conditionals (modified) (1 diff)
-
scripts/features/default_names (modified) (1 diff)
-
scripts/features/double_colon (modified) (1 diff)
-
scripts/features/errors (modified) (5 diffs)
-
scripts/features/escape (modified) (4 diffs)
-
scripts/features/include (modified) (6 diffs)
-
scripts/features/jobserver (added)
-
scripts/features/load (added)
-
scripts/features/loadapi (added)
-
scripts/features/mult_rules (modified) (1 diff)
-
scripts/features/output-sync (added)
-
scripts/features/parallelism (modified) (5 diffs)
-
scripts/features/patspecific_vars (modified) (4 diffs)
-
scripts/features/patternrules (modified) (3 diffs)
-
scripts/features/recursion (modified) (2 diffs)
-
scripts/features/reinvoke (modified) (1 diff)
-
scripts/features/rule_glob (added)
-
scripts/features/se_explicit (modified) (4 diffs)
-
scripts/features/se_implicit (modified) (1 diff)
-
scripts/features/shell_assignment (added)
-
scripts/features/targetvars (modified) (1 diff)
-
scripts/features/utf8 (added)
-
scripts/features/varnesting (modified) (1 diff)
-
scripts/features/vpath (modified) (1 diff)
-
scripts/features/vpath3 (modified) (1 diff)
-
scripts/features/vpathgpath (modified) (1 diff)
-
scripts/features/vpathplus (modified) (2 diffs)
-
scripts/functions/call (modified) (4 diffs)
-
scripts/functions/error (modified) (2 diffs)
-
scripts/functions/file (added)
-
scripts/functions/filter-out (modified) (2 diffs)
-
scripts/functions/foreach (modified) (3 diffs)
-
scripts/functions/guile (added)
-
scripts/functions/shell (modified) (2 diffs)
-
scripts/functions/sort (modified) (1 diff)
-
scripts/functions/warning (modified) (1 diff)
-
scripts/functions/wildcard (modified) (1 diff)
-
scripts/functions/word (modified) (2 diffs)
-
scripts/misc/bs-nl (added)
-
scripts/misc/fopen-fail (added)
-
scripts/misc/general3 (modified) (2 diffs)
-
scripts/misc/utf8 (added)
-
scripts/options/dash-B (modified) (5 diffs)
-
scripts/options/dash-C (modified) (2 diffs)
-
scripts/options/dash-I (modified) (1 diff)
-
scripts/options/dash-W (modified) (4 diffs)
-
scripts/options/dash-k (modified) (4 diffs)
-
scripts/options/dash-n (modified) (3 diffs)
-
scripts/options/dash-q (modified) (2 diffs)
-
scripts/options/eval (modified) (1 diff)
-
scripts/options/print-directory (added)
-
scripts/options/symlinks (modified) (4 diffs)
-
scripts/options/warn-undefined-variables (modified) (1 diff)
-
scripts/targets/DEFAULT (modified) (1 diff)
-
scripts/targets/DELETE_ON_ERROR (added)
-
scripts/targets/INTERMEDIATE (modified) (2 diffs)
-
scripts/targets/ONESHELL (modified) (2 diffs)
-
scripts/targets/POSIX (modified) (3 diffs)
-
scripts/targets/SECONDARY (modified) (4 diffs)
-
scripts/variables/DEFAULT_GOAL (modified) (1 diff)
-
scripts/variables/GNUMAKEFLAGS (added)
-
scripts/variables/LIBPATTERNS (modified) (1 diff)
-
scripts/variables/MAKE (modified) (1 diff)
-
scripts/variables/MAKEFLAGS (modified) (4 diffs)
-
scripts/variables/MAKE_RESTARTS (modified) (3 diffs)
-
scripts/variables/SHELL (modified) (2 diffs)
-
scripts/variables/define (modified) (5 diffs)
-
scripts/variables/flavors (modified) (1 diff)
-
scripts/variables/private (modified) (1 diff)
-
scripts/variables/special (modified) (4 diffs)
-
scripts/vms (added)
-
scripts/vms/library (added)
-
test_driver.pl (modified) (29 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/tests/ChangeLog.1
r3137 r3138 1 2013-10-09 Paul Smith <psmith@gnu.org> 2 3 * scripts/features/patspecific_vars: Typo fixes. 4 5 2013-10-05 Paul Smith <psmith@gnu.org> 6 7 * test_driver.pl (run_all_tests): Rewrite to be more clear. 8 * scripts/features/jobserver: Avoid using $ENV{HOME} as it doesn't 9 exist everywhere. 10 * scripts/features/default_names: End with 1; 11 12 * scripts/features/loadapi: Use new calling signatures. Verify 13 the NOEXPAND flag works. Test with all valid function name 14 characters. 15 16 2013-09-29 Paul Smith <psmith@gnu.org> 17 18 * scripts/variables/SHELL: Solaris /bin/sh can't handle options in 19 multiple words; skip that test. 20 * scripts/targets/ONESHELL: Ditto. 21 22 * scripts/variables/GNUMAKEFLAGS: Verify that GNUMAKEFLAGS is 23 cleared and options are not duplicated. 24 25 2013-09-23 Paul Smith <psmith@gnu.org> 26 27 * scripts/options/print-directory: Rename dash-w to 28 print-directory to avoid conflicts with dash-W on case-insensitive 29 filesystems. 30 31 2013-09-22 Paul Smith <psmith@gnu.org> 32 33 * scripts/features/se_implicit: Verify that order-only tokens 34 inside second expansion are parsed correctly. 35 Test for Savannah bug #31155. 36 37 * run_make_tests.pl (set_more_defaults): If we can't find 38 gnumake.h based on the make program we might be running from a 39 remote build directory. Parse the Makefile for the right path. 40 41 Fix some test issues on Solaris. 42 43 * scripts/features/archives: Determine what output ar gives when 44 adding and replacing objects and compare with that. 45 * scripts/features/escape: Solaris /bin/sh doesn't properly handle 46 backslashes inside single quotes, so don't rely on it. 47 * scripts/features/output-sync: false(1) gives different exit 48 codes on different systems; use "exit 1" instead. 49 * scripts/features/parallelism: Increase the timeout for slower systems. 50 51 2013-09-21 Paul Smith <psmith@gnu.org> 52 53 * scripts/features/archives: Some versions of ar (MacOSX) generate 54 different output when creating archives. Run it and verify the 55 real output. 56 * scripts/features/default_names: MacOSX is, like Windows, 57 case-preserving / case-insensitive. Redo the test to avoid 58 checking for "UNIX". 59 * test_driver.pl (attach_default_output): Don't dup stdout into 60 stderr. Reported by Denis Excoffier <bug-tar@Denis-Excoffier.org> 61 62 * scripts/features/se_explicit: Fix a test that behaves 63 differently with/without archive capability enabled. 64 * scripts/features/output-sync: Don't test output-sync if it's not 65 enabled. We also skip it if parallelism is not enabled, although 66 strictly speaking some of the output-sync tests are valid even 67 without parallelism. 68 * scripts/features/jobserver: Move some tests that require the 69 jobserver from features/parallelism to a separate suite. Only run 70 this if jobserver mode is enabled. 71 72 * scripts/features/output-sync: Test shell functions writing to 73 stderr in recipes: ensure it's captured via output-sync. Test 74 output generated while reading makefiles and make sure it's 75 captured via output-sync. Make sure that fatal errors dump the 76 output so it's not lost. 77 78 * scripts/options/dash-w: Add a test for -w flag. 79 80 2013-09-15 Paul Smith <psmith@gnu.org> 81 82 * scripts/misc/fopen-fail: Check for failure on infinite recursion. 83 * run_make_tests.pl (run_make_test): Allow the answer string to be 84 undef, which means that we shouldn't compare it at all. Only the 85 exit code matters in this case. 86 * test_driver.pl (compare_output): Ditto. 87 Test for Savannah bug #27374. 88 89 * scripts/features/parallelism: Test broken jobserver on recursion. 90 Test for Savannah bug #39934. 91 92 * scripts/options/eval: Verify --eval during restart. 93 Test for Savannah bug #39203. 94 95 2013-09-14 Paul Smith <psmith@gnu.org> 96 97 * scripts/features/output-sync: Verify -Orecurse properly. 98 99 2013-09-12 Paul Smith <psmith@gnu.org> 100 101 * scripts/features/output-sync: Modify for output sync behavior. 102 * scripts/variables/MAKE_RESTARTS: Ditto. 103 * scripts/variables/MAKEFLAGS: Remove mode for --trace. 104 * scripts/variables/GNUMAKEFLAGS: Ditto. 105 106 2013-07-22 Paul Smith <psmith@gnu.org> 107 108 * scripts/features/rule_glob: Add tests for wildcards in rules. 109 Test for Savannah bug #39310. 110 111 2013-07-09 Paul Smith <psmith@gnu.org> 112 113 * scripts/features/se_implicit: Add a test for SE rules depending 114 on other SE rules to be built. 115 116 2013-05-26 Paul Smith <psmith@gnu.org> 117 118 * scripts/features/archives: Test for Savannah bug #38442. 119 120 * scripts/misc/bs-nl: Test for Savannah bug #39035. 121 Add a test for Savannah bug #38945. 122 123 2013-05-22 Paul Smith <psmith@gnu.org> 124 125 * scripts/options/dash-n: Fix results after MAKEFLAGS fixes. 126 * scripts/variables/MAKEFLAGS: Ditto. 127 * scripts/variables/GNUMAKEFLAGS: Ditto. 128 129 2013-05-14 Paul Smith <psmith@gnu.org> 130 131 * scripts/features/loadapi: Add plugin_is_GPL_compatible symbol. 132 * scripts/features/load: Ditto. 133 134 2013-05-13 Paul Smith <psmith@gnu.org> 135 136 * scripts/features/output-sync (output_sync_set): Update for new 137 --trace behavior. 138 139 2013-05-05 Paul Smith <psmith@gnu.org> 140 141 * scripts/features/output-sync (output_sync_set): Remove 142 extraneous enter/leave lines, which are no longer printed. 143 Add tests for syncing command line printing. 144 (output_sync_set): Rename options: "job"->"line"; "make"->"recurse" 145 146 2013-05-04 Paul Smith <psmith@gnu.org> 147 148 * scripts/features/loadapi: Use the new alloc functions. 149 150 * scripts/features/output-sync (output_sync_set): New test for 151 ordered recursive output for -Ojob / -Otarget. 152 153 2013-05-03 Eli Zaretskii <eliz@gnu.org> 154 155 * scripts/features/load: Fix signatures of testload_gmk_setup and 156 explicit_setup, to bring them in line with the documentation. 157 158 2013-04-28 Paul Smith <psmith@gnu.org> 159 160 * scripts/features/output-sync (output_sync_set): Add tests for 161 the per-job syntax mode. 162 (output_sync_set): Test improved error message location. 163 164 2013-04-15 Paul Smith <psmith@gnu.org> 165 166 * scripts/features/output-sync (output_sync_set): New arg syntax. 167 168 2013-04-14 Paul Smith <psmith@gnu.org> 169 170 * scripts/features/output-sync: Rewrite to be more reliable. 171 172 * test_driver.pl (_run_command): Don't set SIGALRM until after we 173 start the child. Print errors to the top-level output, which will 174 be stderr. 175 (attach_default_output): Use a list of file handles as the stack. 176 (detach_default_output): Ditto. 177 178 * scripts/features/output-sync: Add a test for output-sync. 179 180 2013-02-25 Paul Smith <psmith@gnu.org> 181 182 * run_make_tests.pl (valid_option): Support the -srcdir flag. 183 (set_more_defaults): Set up $srcdir if it's not set yet. 184 185 * scripts/functions/guile: Verify gmk-eval doesn't expand twice. 186 * scripts/features/load: Rework to test just the load capability. 187 * scripts/features/loadapi: New set of tests for the load API. 188 189 2013-01-19 Paul Smith <psmith@gnu.org> 190 191 * scripts/features/load: Test loaded files with and without "./" 192 prefix. Add tests for automatically rebuilding loaded files if 193 they are out of date or non-existent. 194 195 2013-01-13 Paul Smith <psmith@gnu.org> 196 197 * scripts/features/archives: Add a check targets that have parens, 198 but are not archives. See Savannah bug #37878. 199 200 * scripts/options/dash-n: Verify -n is preserved after recursive / 201 re-exec. See Savannah bug #38051. 202 203 2013-01-12 Paul Smith <psmith@gnu.org> 204 205 * scripts/features/parallelism: Change rule so it doesn't depend 206 on invocation order, etc. 207 208 2012-10-29 Paul Smith <psmith@gnu.org> 209 210 * scripts/features/load: New test suite for the "load" directive. 211 212 2012-09-09 Paul Smith <psmith@gnu.org> 213 214 * scripts/functions/file: Get errors in the C locale, not the 215 current locale. Fixes Savannah bug #35764. 216 217 * scripts/features/escape: Check that backslashes before 218 non-special characters are not removed. 219 220 * scripts/features/utf8: New test for UTF-8 support. 221 See Savannah bug #36529. 222 223 * scripts/targets/POSIX: Add tests for default macro values as 224 specified by IEEE Std 1003.1-2008. See Savannah bug #37069. 225 226 2012-03-04 Paul Smith <psmith@gnu.org> 227 228 * scripts/features/se_explicit: Test $(x:%=%) format in secondary 229 expansion prerequisite lists. See Savannah bug #16545. 230 231 * scripts/features/escape: Test escaped ":" in prerequisite lists. 232 See Savannah bug #12126. 233 234 * scripts/variables/private: Test appending private variables in 235 pattern-specific target rules. See Savannah bug #35468. 236 237 2012-03-03 Paul Smith <psmith@gnu.org> 238 239 * scripts/variables/SHELL: Ensure .SHELLFLAGS works with options 240 separated by whitespace. 241 242 * scripts/targets/ONESHELL: Try .ONESHELL in combination with 243 whitespace-separated options in .SHELLFLAGS. See Savannah bug #35397. 244 245 * scripts/functions/filter-out: Add filter tests and test escape 246 operations. See Savannah bug #35410. 247 248 * guile.supp: Suppress valgrind errors from Guile 249 * run_make_tests.pl: Use the Guile suppression file. 250 251 * scripts/misc/bs-nl: Check for POSIX and non-POSIX 252 backslash/newline handling. Addresses Savannah bug #16670. 253 254 2012-01-29 Paul Smith <psmith@gnu.org> 255 256 * scripts/variables/flavors: Add tests for ::= 257 * scripts/variables/define: Ditto 258 259 * scripts/functions/file: Test the new $(file ...) function. 260 261 2012-01-12 Paul Smith <psmith@gnu.org> 262 263 * scripts/functions/guile: New regression tests for Guile support. 264 265 2011-12-10 Paul Smith <psmith@gnu.org> 266 267 * scripts/targets/SECONDARY: Add prereq statements to ensure rules 268 are printed in the right order for test #9 269 270 2011-11-14 Paul Smith <psmith@gnu.org> 271 272 * scripts/features/double_colon: Check double-colon with escaped 273 filenames. See Savannah bug #33399. 274 275 2011-09-18 Paul Smith <psmith@gnu.org> 276 277 * scripts/features/parallelism: On re-exec make sure we preserve 278 the value of MAKEFLAGS when necessary. See Savannah bug #33873. 279 280 * scripts/features/vpath3: Verify handling of -lfoo libraries 281 found via vpath vs. the standard directory search. 282 See Savannah bug #32511. 283 284 2011-09-12 Paul Smith <psmith@gnu.org> 285 286 * scripts/functions/call: Verify that using export in a $(call ...) 287 context creates a global variable. See Savannah bug #32498. 288 289 2011-09-02 Paul Smith <psmith@gnu.org> 290 291 * scripts/options/dash-n: Verify that in "-n -t", the -n takes 292 priority. Patch from Michael Witten <mfwitten@gmail.com>. 293 294 2011-08-29 Paul Smith <psmith@gnu.org> 295 296 * scripts/features/varnesting: Test resetting of variables while 297 expanding them. See Savannah patch #7534 298 299 2011-06-12 Paul Smith <psmith@gnu.org> 300 301 * scripts/features/archives: Check archives with whitespace at the 302 beginning, end, and extra in the middle. 303 Another test for Savannah bug #30612. 304 305 2011-05-07 Paul Smith <psmith@gnu.org> 306 307 * scripts/variables/private: Ensure we skip private variables when 308 appending. Test for Savannah bug #32872. 309 310 * scripts/functions/wildcard: Verify wildcard used to test for 311 file existence/non-existence. 312 313 2011-05-02 Paul Smith <psmith@gnu.org> 314 315 * scripts/functions/sort: Add a test for Savannah bug #33125. 316 317 2011-04-17 David A. Wheeler <dwheeler@dwheeler.com> 318 319 * scripts/features/shell_assignment: Regression for "!=" feature 320 321 2010-11-06 Paul Smith <psmith@gnu.org> 322 323 * scripts/features/targetvars: Fix known-good output for BS/NL changes. 324 * scripts/functions/call: Ditto. 325 * scripts/variables/special: Ditto. 326 327 * scripts/misc/bs-nl: New test suite for backslash/newline testing. 328 329 2010-08-29 Paul Smith <psmith@gnu.org> 330 331 * scripts/features/errors: Add new error message to output text. 332 * scripts/variables/SHELL: Ditto. 333 * scripts/targets/POSIX: Ditto. 334 * scripts/options/dash-k: Ditto. 335 * scripts/features/vpathplus: Ditto. 336 * scripts/features/patternrules: Ditto. 337 * scripts/features/parallelism: Ditto. 338 339 2010-08-13 Paul Smith <psmith@gnu.org> 340 341 * scripts/features/archives: New regression tests for archive 342 support. Test for fix to Savannah bug #30612. 343 344 * run_make_tests.pl (set_more_defaults): Set a %FEATURES hash to 345 the features available in $(.FEATURES). 346 347 2010-08-10 Paul Smith <psmith@gnu.org> 348 349 * scripts/features/reinvoke: Ensure command line variable settings 350 are preserved across make re-exec. Tests Savannah bug #30723. 351 1 352 2010-07-28 Paul Smith <psmith@gnu.org> 2 353 … … 300 651 beginning with "."). 301 652 302 * scripts/functions/andor: Tests for $(and .. ) and $(or ...)653 * scripts/functions/andor: Tests for $(and ...) and $(or ...) 303 654 functions. 304 655 … … 387 738 2005-08-13 Boris Kolpackov <boris@kolpackov.net> 388 739 389 * scripts/functions/wildcard: Wrap calls to $(wildcard ) with740 * scripts/functions/wildcard: Wrap calls to $(wildcard) with 390 741 $(sort) so that the resulting order is no longer filesystem- 391 depend ant.742 dependent. 392 743 393 744 2005-08-10 Boris Kolpackov <boris@kolpackov.net> … … 460 811 2005-06-09 Paul D. Smith <psmith@gnu.org> 461 812 462 * scripts/functions/foreach: Add a test for Savannah bug #11913.813 * scripts/functions/foreach: Add a test for Savannah bug #11913. 463 814 464 815 2005-05-31 Boris Kolpackov <boris@kolpackov.net> … … 480 831 481 832 * scripts/features/parallelism: Add a test for exporting recursive 482 variables containing $(shell ) calls. Rewrite this script to use833 variables containing $(shell) calls. Rewrite this script to use 483 834 run_make_test() everywhere. 484 835 … … 1064 1415 1065 1416 1066 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 1067 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 1417 Copyright (C) 1992-2016 Free Software Foundation, Inc. 1068 1418 This file is part of GNU Make. 1069 1419 -
vendor/gnumake/current/tests/NEWS
r2596 r3138 73 73 Also, some tests and stuff still haven't made it in because I 74 74 haven't had time to write the test scripts for them. But they, 75 too, will get in eventually. Contributions of scripts (i e, tests75 too, will get in eventually. Contributions of scripts (i.e., tests 76 76 that I can just drop in) are particularly welcome and will be 77 77 incorporated immediately. … … 164 164 165 165 ------------------------------------------------------------------------------- 166 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 167 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 166 Copyright (C) 1992-2016 Free Software Foundation, Inc. 168 167 This file is part of GNU Make. 169 168 -
vendor/gnumake/current/tests/README
r2596 r3138 8 8 9 9 ----------------------------------------------------------------------------- 10 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 11 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 10 Copyright (C) 1992-2016 Free Software Foundation, Inc. 12 11 This file is part of GNU Make. 13 12 … … 40 39 41 40 By default, the test engine picks up the first executable called "make" 42 that it finds in your path. You may use the -make_path option (i e,41 that it finds in your path. You may use the -make_path option (i.e., 43 42 "perl run_make_tests -make_path /usr/local/src/make-3.78/make") if 44 43 you want to run a particular copy. This now works correctly with … … 60 59 make to be setgid sys or kmem for this; if you don't want to install 61 60 make just to test it, make it setgid to kmem or whatever group /dev/kmem 62 is (i e, "chgrp kmem make;chmod g+s make" as root). In any case, the61 is (i.e., "chgrp kmem make;chmod g+s make" as root). In any case, the 63 62 options/dash-l test should no longer *fail* because make can't read 64 63 /dev/kmem. -
vendor/gnumake/current/tests/mkshadow
r2596 r3138 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, 2007, 2008, 2009, 2010 Free Software 8 # Foundation, Inc. 6 # Copyright (C) 1992-2016 Free Software Foundation, Inc. 9 7 # This file is part of GNU Make. 10 8 # … … 29 27 30 28 if [ ! -d "$dest" ]; then 31 echo "Destination directory \`$dest' must exist!"29 echo "Destination directory '$dest' must exist!" 32 30 exit 1 33 31 fi … … 56 54 rm -rf work 57 55 58 echo "Shadow test suite created in \`$dest/$name'."56 echo "Shadow test suite created in '$dest/$name'." 59 57 exit 0 -
vendor/gnumake/current/tests/run_make_tests.pl
r2596 r3138 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, 2007, 2008, 2009, 2010 Free Software 16 # Foundation, Inc. 14 # Copyright (C) 1992-2016 Free Software Foundation, Inc. 17 15 # This file is part of GNU Make. 18 16 # … … 30 28 # this program. If not, see <http://www.gnu.org/licenses/>. 31 29 30 %FEATURES = (); 32 31 33 32 $valgrind = 0; # invoke make with valgrind 34 33 $valgrind_args = ''; 35 $memcheck_args = '--num-callers=15 --tool=memcheck --leak-check=full ';34 $memcheck_args = '--num-callers=15 --tool=memcheck --leak-check=full --suppressions=guile.supp'; 36 35 $massif_args = '--num-callers=15 --tool=massif --alloc-fn=xmalloc --alloc-fn=xcalloc --alloc-fn=xrealloc --alloc-fn=xstrdup --alloc-fn=xstrndup'; 37 36 $pure_log = undef; 38 37 38 # The location of the GNU make source directory 39 $srcdir = ''; 40 39 41 $command_string = ''; 40 42 41 43 $all_tests = 0; 42 44 45 # rmdir broken in some Perls on VMS. 46 if ($^O eq 'VMS') 47 { 48 require VMS::Filespec; 49 VMS::Filespec->import(); 50 51 sub vms_rmdir { 52 my $vms_file = vmspath($_[0]); 53 $vms_file = fileify($vms_file); 54 my $ret = unlink(vmsify($vms_file)); 55 return $ret 56 }; 57 58 *CORE::GLOBAL::rmdir = \&vms_rmdir; 59 } 60 43 61 require "test_driver.pl"; 62 require "config-flags.pm"; 44 63 45 64 # Some target systems might not have the POSIX module... … … 61 80 } 62 81 82 if ($option =~ /^-srcdir$/i) { 83 $srcdir = shift @argv; 84 if (! -f "$srcdir/gnumake.h") { 85 print "$option $srcdir: Not a valid GNU make source directory.\n"; 86 exit 0; 87 } 88 return 1; 89 } 90 63 91 if ($option =~ /^-all([-_]?tests)?$/i) { 64 92 $all_tests = 1; … … 99 127 $old_makefile = undef; 100 128 129 sub subst_make_string 130 { 131 local $_ = shift; 132 $makefile and s/#MAKEFILE#/$makefile/g; 133 s/#MAKEPATH#/$mkpath/g; 134 s/#MAKE#/$make_name/g; 135 s/#PERL#/$perl_name/g; 136 s/#PWD#/$pwd/g; 137 return $_; 138 } 139 101 140 sub run_make_test 102 141 { 103 142 local ($makestring, $options, $answer, $err_code, $timeout) = @_; 143 my @call = caller; 104 144 105 145 # If the user specified a makefile string, create a new makefile to contain … … 116 156 } 117 157 118 # Make sure it ends in a newline .158 # Make sure it ends in a newline and substitute any special tokens. 119 159 $makestring && $makestring !~ /\n$/s and $makestring .= "\n"; 120 121 # Replace @MAKEFILE@ with the makefile name and @MAKE@ with the path to 122 # make 123 $makestring =~ s/#MAKEFILE#/$makefile/g; 124 $makestring =~ s/#MAKEPATH#/$mkpath/g; 125 $makestring =~ s/#MAKE#/$make_name/g; 126 $makestring =~ s/#PERL#/$perl_name/g; 127 $makestring =~ s/#PWD#/$pwd/g; 160 $makestring = subst_make_string($makestring); 128 161 129 162 # Populate the makefile! … … 134 167 135 168 # Do the same processing on $answer as we did on $makestring. 136 137 $answer && $answer !~ /\n$/s and $answer .= "\n"; 138 $answer =~ s/#MAKEFILE#/$makefile/g; 139 $answer =~ s/#MAKEPATH#/$mkpath/g; 140 $answer =~ s/#MAKE#/$make_name/g; 141 $answer =~ s/#PERL#/$perl_name/g; 142 $answer =~ s/#PWD#/$pwd/g; 169 if (defined $answer) { 170 $answer && $answer !~ /\n$/s and $answer .= "\n"; 171 $answer = subst_make_string($answer); 172 } 143 173 144 174 run_make_with_options($makefile, $options, &get_logfile(0), 145 $err_code, $timeout );175 $err_code, $timeout, @call); 146 176 &compare_output($answer, &get_logfile(1)); 147 177 … … 152 182 # The old-fashioned way... 153 183 sub run_make_with_options { 154 local ($filename,$options,$logname,$expected_code,$timeout) = @_; 184 my ($filename,$options,$logname,$expected_code,$timeout,@call) = @_; 185 @call = caller unless @call; 155 186 local($code); 156 187 local($command) = $make_path; … … 166 197 167 198 if ($options) { 199 if ($^O eq 'VMS') { 200 # Try to make sure arguments are properly quoted. 201 # This does not handle all cases. 202 203 # VMS uses double quotes instead of single quotes. 204 $options =~ s/\'/\"/g; 205 206 # If the leading quote is inside non-whitespace, then the 207 # quote must be doubled, because it will be enclosed in another 208 # set of quotes. 209 $options =~ s/(\S)(\".*\")/$1\"$2\"/g; 210 211 # Options must be quoted to preserve case if not already quoted. 212 $options =~ s/(\S+)/\"$1\"/g; 213 214 # Special fixup for embedded quotes. 215 $options =~ s/(\"\".+)\"(\s+)\"(.+\"\")/$1$2$3/g; 216 217 $options =~ s/(\A)(?:\"\")(.+)(?:\"\")/$1\"$2\"/g; 218 219 # Special fixup for misc/general4 test. 220 $options =~ s/""\@echo" "cc""/\@echo cc"/; 221 $options =~ s/"\@echo link"""/\@echo link"/; 222 223 # Remove shell escapes expected to be removed by bash 224 if ($options !~ /path=pre/) { 225 $options =~ s/\\//g; 226 } 227 228 # special fixup for options/eval 229 $options =~ s/"--eval=\$\(info" "eval/"--eval=\$\(info eval/; 230 231 print ("Options fixup = -$options-\n") if $debug; 232 } 168 233 $command .= " $options"; 169 234 } 170 235 171 $command_string = "$command\n"; 236 $command_string = ""; 237 if (@call) { 238 $command_string = "#$call[1]:$call[2]\n"; 239 } 240 $command_string .= "$command\n"; 172 241 173 242 if ($valgrind) { … … 184 253 185 254 $code = &run_command_with_output($logname,$command); 186 187 255 $test_timeout = $old_timeout; 188 256 } … … 229 297 { 230 298 &print_standard_usage ("run_make_tests", 231 "[-make _path make_pathname] [-memcheck] [-massif]",);299 "[-make MAKE_PATHNAME] [-srcdir SRCDIR] [-memcheck] [-massif]",); 232 300 } 233 301 … … 235 303 { 236 304 &print_standard_help ( 237 "-make _path",305 "-make", 238 306 "\tYou may specify the pathname of the copy of make to run.", 307 "-srcdir", 308 "\tSpecify the make source directory.", 239 309 "-valgrind", 240 310 "-memcheck", … … 296 366 $port_type = 'OS/2'; 297 367 } 368 369 # VMS has a GNV Unix mode or a DCL mode. 370 # The SHELL environment variable should not be defined in VMS-DCL mode. 371 elsif ($osname eq 'VMS' && !defined $ENV{"SHELL"}) { 372 $port_type = 'VMS-DCL'; 373 } 298 374 # Everything else, right now, is UNIX. Note that we should integrate 299 375 # the VOS support into this as well and get rid of $vos; we'll do … … 313 389 # Find the full pathname of Make. For DOS systems this is more 314 390 # complicated, so we ask make itself. 315 my $mk = `sh -c 'echo "all:;\@echo \\\$(MAKE)" | $make_path -f-'`; 316 chop $mk; 317 $mk or die "FATAL ERROR: Cannot determine the value of \$(MAKE):\n 391 if ($osname eq 'VMS') { 392 $port_type = 'VMS-DCL' unless defined $ENV{"SHELL"}; 393 # On VMS pre-setup make to be found with simply 'make'. 394 $make_path = 'make'; 395 } else { 396 my $mk = `sh -c 'echo "all:;\@echo \\\$(MAKE)" | $make_path -f-'`; 397 chop $mk; 398 $mk or die "FATAL ERROR: Cannot determine the value of \$(MAKE):\n 318 399 'echo \"all:;\@echo \\\$(MAKE)\" | $make_path -f-' failed!\n"; 319 $make_path = $mk; 320 print "Make\t= `$make_path'\n" if $debug; 321 322 $string = `$make_path -v -f /dev/null 2> /dev/null`; 400 $make_path = $mk; 401 } 402 print "Make\t= '$make_path'\n" if $debug; 403 404 my $redir2 = '2> /dev/null'; 405 $redir2 = '' if os_name eq 'VMS'; 406 $string = `$make_path -v -f /dev/null $redir2`; 323 407 324 408 $string =~ /^(GNU Make [^,\n]*)/; 325 409 $testee_version = "$1\n"; 326 410 327 $string = `sh -c "$make_path -f /dev/null 2>&1"`; 411 my $redir = '2>&1'; 412 $redir = '' if os_name eq 'VMS'; 413 $string = `sh -c "$make_path -f /dev/null $redir"`; 328 414 if ($string =~ /(.*): \*\*\* No targets\. Stop\./) { 329 415 $make_name = $1; 330 416 } 331 417 else { 332 if ($make_path =~ /$pathsep([^\n$pathsep]*)$/) { 333 $make_name = $1; 334 } 335 else { 336 $make_name = $make_path; 337 } 418 $make_path =~ /^(?:.*$pathsep)?(.+)$/; 419 $make_name = $1; 338 420 } 339 421 … … 349 431 { 350 432 $mkpath = $make_path; 433 } 434 435 # If srcdir wasn't provided on the command line, see if the 436 # location of the make program gives us a clue. Don't fail if not; 437 # we'll assume it's been installed into /usr/include or wherever. 438 if (! $srcdir) { 439 $make_path =~ /^(.*$pathsep)?/; 440 my $d = $1 || '../'; 441 -f "${d}gnumake.h" and $srcdir = $d; 442 } 443 444 # Not with the make program, so see if we can get it out of the makefile 445 if (! $srcdir && open(MF, "< ../Makefile")) { 446 local $/ = undef; 447 $_ = <MF>; 448 close(MF); 449 /^abs_srcdir\s*=\s*(.*?)\s*$/m; 450 -f "$1/gnumake.h" and $srcdir = $1; 351 451 } 352 452 … … 360 460 } 361 461 362 $string = `sh -c "$make_path -j 2 -f /dev/null 2>&1"`;462 $string = `sh -c "$make_path -j 2 -f /dev/null $redir"`; 363 463 if ($string =~ /not supported/) { 364 464 $parallel_jobs = 0; … … 368 468 } 369 469 470 %FEATURES = map { $_ => 1 } split /\s+/, `sh -c "echo '\\\$(info \\\$(.FEATURES))' | $make_path -f- 2>/dev/null"`; 471 370 472 # Set up for valgrind, if requested. 473 474 $make_command = $make_path; 371 475 372 476 if ($valgrind) { -
vendor/gnumake/current/tests/scripts/features/conditionals
r2596 r3138 142 142 'success'); 143 143 144 # SV 47960 : ensure variable assignments in non-taken legs don't cause problems 145 run_make_test(' 146 ifneq ($(FOO),yes) 147 target: 148 else 149 BAR = bar 150 target: 151 endif 152 @echo one 153 ', 154 '', "one\n"); 155 144 156 145 157 # This tells the test driver that the perl test script executed properly. 146 158 1; 159 160 ### Local Variables: 161 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 162 ### End: -
vendor/gnumake/current/tests/scripts/features/default_names
r2596 r3138 11 11 close(MAKEFILE); 12 12 13 # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile. 14 # Just test what we can here (avoid Makefile versus makefile test). 13 # Create another makefile called "makefile" 14 open(MAKEFILE,"> makefile"); 15 print MAKEFILE "SECOND: ; \@echo It chose makefile\n"; 16 close(MAKEFILE); 15 17 16 if ($port_type eq 'UNIX') { 17 # Create another makefile called "makefile" 18 open(MAKEFILE,"> makefile"); 19 print MAKEFILE "SECOND: ; \@echo It chose makefile\n"; 20 close(MAKEFILE); 18 # DOS/WIN32/MacOSX platforms are case-insensitive / case-preserving, so 19 # Makefile is the same file as makefile. Just test what we can here. 20 21 my $case_sensitive = 0; 22 if (! -f 'Makefile') { 23 # Create another makefile called "Makefile" 24 $case_sensitive = 1; 25 open(MAKEFILE,"> Makefile"); 26 print MAKEFILE "THIRD: ; \@echo It chose Makefile\n"; 27 close(MAKEFILE); 21 28 } 22 29 23 # Create another makefile called "Makefile" 24 open(MAKEFILE,"> Makefile"); 25 print MAKEFILE "THIRD: ; \@echo It chose Makefile\n"; 26 close(MAKEFILE); 30 run_make_with_options("","",&get_logfile); 31 compare_output("It chose GNUmakefile\n",&get_logfile(1)); 32 unlink($makefile); 27 33 34 run_make_with_options("","",&get_logfile); 35 compare_output("It chose makefile\n",&get_logfile(1)); 36 unlink("makefile"); 28 37 29 &run_make_with_options("","",&get_logfile); 30 &compare_output("It chose GNUmakefile\n",&get_logfile(1)); 31 unlink $makefile; 32 33 if ($port_type eq 'UNIX') { 34 &run_make_with_options("","",&get_logfile); 35 &compare_output("It chose makefile\n",&get_logfile(1)); 36 unlink "makefile"; 38 if ($case_sensitive) { 39 run_make_with_options("","",&get_logfile); 40 compare_output("It chose Makefile\n",&get_logfile(1)); 41 unlink("Makefile"); 37 42 } 38 43 39 &run_make_with_options("","",&get_logfile); 40 &compare_output("It chose Makefile\n",&get_logfile(1)); 41 unlink "Makefile"; 44 1; -
vendor/gnumake/current/tests/scripts/features/double_colon
r2596 r3138 152 152 unlink('result','one','two'); 153 153 154 # TEST 10: SV 33399 : check for proper backslash handling 155 156 run_make_test(' 157 a\ xb :: ; @echo one 158 a\ xb :: ; @echo two 159 ', 160 '', "one\ntwo\n"); 161 162 # Test 11: SV 44742 : All double-colon rules should be run in parallel build. 163 164 run_make_test('result :: 01 165 @echo update 166 @touch $@ 167 result :: 02 168 @echo update 169 @touch $@ 170 result :: 03 171 @echo update 172 @touch $@ 173 result :: 04 174 @echo update 175 @touch $@ 176 result :: 05 177 @echo update 178 @touch $@ 179 01 02 03 04 05: 180 @touch 01 02 03 04 05 181 ', 182 '-j10 result', "update\nupdate\nupdate\nupdate\nupdate\n"); 183 184 unlink('result', '01', '02', '03', '04', '05'); 185 186 # Test 12: SV 44742 : Double-colon rules with parallelism 187 188 run_make_test(' 189 root: all 190 echo root 191 all:: 192 echo all_one 193 all:: 3 194 echo all_two 195 %: 196 sleep $* 197 ', 198 '-rs -j2 1 2 root', "all_one\nall_two\nroot\n"); 199 200 # SV 47995 : Parallel double-colon rules with FORCE 201 202 run_make_test(' 203 all:: ; @echo one 204 205 all:: joe ; @echo four 206 207 joe: FORCE ; touch joe-is-forced 208 209 FORCE: 210 ', 211 '-j5', "one\ntouch joe-is-forced\nfour\n"); 212 213 unlink('joe-is-forced'); 214 154 215 # This tells the test driver that the perl test script executed properly. 155 216 1; 217 218 ### Local Variables: 219 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 220 ### End: -
vendor/gnumake/current/tests/scripts/features/errors
r2596 r3138 31 31 ."\t-$rm_command cleanit\n" 32 32 ."\t$rm_command foo\n" 33 ."clean2: \n"33 ."clean2: \n" 34 34 ."\t$rm_command cleanit\n" 35 35 ."\t$rm_command foo\n"; … … 43 43 unlink("cleanit"); 44 44 $cleanit_error = `sh -c "$rm_command cleanit 2>&1"`; 45 chomp $cleanit_error; 45 46 $delete_error_code = $? >> 8; 46 47 … … 48 49 # ------- 49 50 50 $answer = "$rm_command cleanit \n"51 .$cleanit_error52 ."$make_name: [clean] Error $delete_error_code (ignored)\n" 53 ."$rm_command foo\n";51 $answer = "$rm_command cleanit 52 $cleanit_error 53 $make_name: [$makefile:2: clean] Error $delete_error_code (ignored) 54 $rm_command foo\n"; 54 55 55 56 &run_make_with_options($makefile,"",&get_logfile); … … 75 76 # ------- 76 77 77 $answer = "$rm_command cleanit \n"78 .$cleanit_error79 ."$make_name: [clean2] Error $delete_error_code (ignored)\n" 80 ."$rm_command foo\n";78 $answer = "$rm_command cleanit 79 $cleanit_error 80 $make_name: [$makefile:5: clean2] Error $delete_error_code (ignored) 81 $rm_command foo\n"; 81 82 82 83 &run_make_with_options($makefile,"clean2 -i",&get_logfile); … … 90 91 } 91 92 93 # Test that error line offset works 94 95 run_make_test(q! 96 all: 97 @echo hi 98 @echo there 99 @exit 1 100 !, 101 '', "hi\nthere\n#MAKE#: *** [#MAKEFILE#:5: all] Error 1", 512); 102 92 103 1; 104 105 ### Local Variables: 106 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 107 ### End: -
vendor/gnumake/current/tests/scripts/features/escape
r2596 r3138 3 3 4 4 $details = "\ 5 Make sure that escaping of `:' works in target names.5 Make sure that escaping of ':' works in target names. 6 6 Make sure escaping of whitespace works in target names. 7 Make sure that escaping of '#' works."; 8 9 10 close(MAKEFILE); 7 Make sure that escaping of '#' works. 8 Make sure that backslash before non-special characters are kept."; 11 9 12 10 … … 27 25 run_make_test(undef, 28 26 'path=pre:', 29 "#MAKEFILE#:2: *** target pattern contains no `%'. Stop.",27 "#MAKEFILE#:2: *** target pattern contains no '%'. Stop.", 30 28 512); 31 29 … … 40 38 run_make_test(undef, 41 39 "'path=pre\\\\:'", 42 "#MAKEFILE#:2: *** target pattern contains no `%'. Stop.",40 "#MAKEFILE#:2: *** target pattern contains no '%'. Stop.", 43 41 512); 44 42 … … 55 53 'foo#bar.ext = (foo#bar.ext)'); 56 54 55 # Test escaped colons in prerequisites 56 # Quoting of backslashes in q!! is kind of messy. 57 # Solaris sh does not properly handle backslashes even in '' so just 58 # check the output make prints, not what the shell interprets. 59 run_make_test(q! 60 foo: foo\\:bar foo\\\\\\:bar foo\\\\\\\\\\:bar 61 foo foo\\:bar foo\\\\\\:bar foo\\\\\\\\\\:bar: ; : '$@' 62 !, 63 '', ": 'foo:bar'\n: 'foo\\:bar'\n: 'foo\\\\:bar'\n: 'foo'\n"); 64 65 # Test backslash before non-special chars: should be kept as-is 66 67 run_make_test(q! 68 all: ..\foo 69 .DEFAULT: ; : '$@' 70 !, 71 '', ": '..\\foo'\n"); 72 57 73 # This tells the test driver that the perl test script executed properly. 58 74 1; -
vendor/gnumake/current/tests/scripts/features/include
r2596 r3138 1 1 # -*-mode: perl; rm-trailing-spaces: nil-*- 2 2 3 $description = "Test various forms of the GNU make `include' command.";3 $description = "Test various forms of the GNU make 'include' command."; 4 4 5 5 $details = "\ … … 61 61 ', 62 62 '', 63 "#MAKE#: *** No rule to make target `foo.mk', needed by `error'. Stop.\n",63 "#MAKE#: *** No rule to make target 'foo.mk', needed by 'error'. Stop.\n", 64 64 512 65 65 ); … … 129 129 ', 130 130 '', 131 "#MAKE#: *** No rule to make target `baz', needed by `bar'. Stop.\n",131 "#MAKE#: *** No rule to make target 'baz', needed by 'bar'. Stop.\n", 132 132 512); 133 133 … … 145 145 ', 146 146 '', 147 "#MAKE#: *** No rule to make target `end', needed by `baz'. Stop.\n",147 "#MAKE#: *** No rule to make target 'end', needed by 'baz'. Stop.\n", 148 148 512); 149 149 … … 163 163 '', 164 164 "#MAKEFILE#:2: bar: No such file or directory 165 #MAKE#: *** No rule to make target `end', needed by `baz'. Stop.\n",165 #MAKE#: *** No rule to make target 'end', needed by 'baz'. Stop.\n", 166 166 512); 167 168 # Test include of make-able file doesn't show an error (Savannah #102) 169 run_make_test(q! 170 .PHONY: default 171 default:; @echo DONE 172 173 inc1:; echo > $@ 174 include inc1 175 include inc2 176 inc2:; echo > $@ 177 !, 178 '', "echo > inc2\necho > inc1\nDONE\n"); 179 180 rmfiles('inc1', 'inc2'); 181 182 # Test include of non-make-able file does show an error (Savannah #102) 183 run_make_test(q! 184 .PHONY: default 185 default:; @echo DONE 186 187 inc1:; echo > $@ 188 include inc1 189 include inc2 190 !, 191 '', "#MAKEFILE#:7: inc2: No such file or directory\n#MAKE#: *** No rule to make target 'inc2'. Stop.\n", 512); 192 193 rmfiles('inc1'); 194 195 # Include same file multiple times 196 197 run_make_test(q! 198 default:; @echo DEFAULT 199 include inc1 200 inc1:; echo > $@ 201 include inc1 202 !, 203 '', "echo > inc1\nDEFAULT\n"); 204 205 rmfiles('inc1'); 206 207 # Included file has a prerequisite that fails to build 208 209 run_make_test(q! 210 default:; @echo DEFAULT 211 include inc1 212 inc1: foo; echo > $@ 213 foo:; exit 1 214 !, 215 '', "exit 1\n#MAKEFILE#:3: inc1: No such file or directory\n#MAKE#: *** [#MAKEFILE#:5: foo] Error 1\n", 512); 216 217 rmfiles('inc1'); 218 219 # Included file has a prerequisite we don't know how to build 220 221 run_make_test(q! 222 default:; @echo DEFAULT 223 include inc1 224 inc1: foo; echo > $@ 225 !, 226 '', "#MAKEFILE#:3: inc1: No such file or directory\n#MAKE#: *** No rule to make target 'foo', needed by 'inc1'. Stop.\n", 512); 227 228 rmfiles('inc1'); 229 230 # include a directory 167 231 168 232 if ($all_tests) { … … 173 237 foo: ; @echo foo = bar > $@ 174 238 !, 175 '', "#MAKE#: `foo' is up to date.\n");239 '', "#MAKE#: 'foo' is up to date.\n"); 176 240 rmfiles('foo'); 177 241 } -
vendor/gnumake/current/tests/scripts/features/mult_rules
r2596 r3138 48 48 49 49 # Create the answer to what should be produced by this Makefile 50 $answer = "$make_name: *** No rule to make target `extra.h', needed by `foo.o'. Stop.\n";50 $answer = "$make_name: *** No rule to make target 'extra.h', needed by 'foo.o'. Stop.\n"; 51 51 52 52 &compare_output($answer,&get_logfile(1)); -
vendor/gnumake/current/tests/scripts/features/parallelism
r2596 r3138 42 42 2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@", 43 43 "-j4", 44 "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n" );44 "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n", 0, 7); 45 45 46 46 rmfiles(qw(1.inc 2.inc)); … … 61 61 2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@", 62 62 "-j4", 63 "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n" );63 "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n", 0, 7); 64 64 65 65 rmfiles(qw(1.inc 2.inc)); … … 92 92 93 93 fail.1 fail.2 fail.3: 94 \@ sleep\$(patsubst fail.%,%,\$\@)94 \@$sleep_command \$(patsubst fail.%,%,\$\@) 95 95 \@echo Fail 96 96 \@exit 1 97 97 98 98 ok: 99 \@ sleep499 \@$sleep_command 4 100 100 \@echo Ok done", 101 '-rR -j5', 'Fail102 #MAKE#: *** [ fail.1] Error 1101 '-rR -j5', "Fail 102 #MAKE#: *** [#MAKEFILE#:8: fail.1] Error 1 103 103 #MAKE#: *** Waiting for unfinished jobs.... 104 104 Fail 105 #MAKE#: *** [ fail.2] Error 1105 #MAKE#: *** [#MAKEFILE#:8: fail.2] Error 1 106 106 Fail 107 #MAKE#: *** [ fail.3] Error 1108 Ok done ',107 #MAKE#: *** [#MAKEFILE#:8: fail.3] Error 1 108 Ok done", 109 109 512); 110 110 … … 141 141 rmfiles('target'); 142 142 143 # TEST #10: Don't put --jobserver-fds into a re-exec'd MAKEFLAGS. 144 # We can't test this directly because there's no way a makefile can 145 # show the value of MAKEFLAGS we were re-exec'd with. We can intuit it 146 # by looking for "disabling jobserver mode" warnings; we should only 147 # get one from the original invocation and none from the re-exec. 148 # See Savannah bug #18124 143 # TEST #11: Make sure -jN from MAKEFLAGS is processed even when we re-exec 144 # See Savannah bug #33873 145 146 $extraENV{MAKEFLAGS} = '-j4'; 149 147 150 148 run_make_test(q! 149 things = thing1 thing2 150 all: $(things) 151 thing1:; @sleep 1; echo '$@ start'; sleep 2; echo '$@ end' 152 thing2:; @echo '$@ start'; sleep 2; echo '$@ end' 151 153 -include inc.mk 152 recur: 153 # @echo 'MAKEFLAGS = $(MAKEFLAGS)' 154 @rm -f inc.mk 155 @$(MAKE) -j2 -f #MAKEFILE# all 156 all: 157 # @echo 'MAKEFLAGS = $(MAKEFLAGS)' 158 @echo $@ 159 inc.mk: 160 # @echo 'MAKEFLAGS = $(MAKEFLAGS)' 161 @echo 'FOO = bar' > $@ 154 inc.mk: ; @touch $@ 162 155 !, 163 '--no-print-directory -j2', "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n"); 164 156 '', "thing2 start\nthing1 start\nthing2 end\nthing1 end\n"); 157 158 delete $extraENV{MAKEFLAGS}; 165 159 rmfiles('inc.mk'); 166 160 167 if ($all_tests) { 168 # Implicit files aren't properly recreated during parallel builds 169 # Savannah bug #26864 170 171 # The first run works fine 172 run_make_test(q! 173 %.bar: %.x foo.y ; cat $^ > $@ 174 %.x: ; touch $@ 175 foo.y: foo.y.in ; cp $< $@ 176 foo.y.in: ; touch $@ 161 # Ensure intermediate/secondary files are not pruned incorrectly. 162 # See Savannah bug #30653 163 164 utouch(-15, 'file2'); 165 utouch(-10, 'file4'); 166 utouch(-5, 'file1'); 167 168 run_make_test(q! 169 .INTERMEDIATE: file3 170 file4: file3 ; @mv -f $< $@ 171 file3: file2 ; touch $@ 172 file2: file1 ; @touch $@ 177 173 !, 178 '-j2 main.bar', 179 "touch foo.y.in 180 touch main.x 181 cp foo.y.in foo.y 182 cat main.x foo.y > main.bar 183 rm main.x"); 184 185 # Now we touch the .in file and make sure it still works 186 touch('foo.y.in'); 187 188 run_make_test(undef, '-j2 main.bar', "cp foo.y.in foo.y 189 touch main.x 190 cat main.x foo.y > main.bar 191 rm main.x"); 192 193 # Clean up 194 rmfiles(qw(foo.y foo.y.in main.bar)); 195 } 196 197 if ($all_tests) { 198 # Jobserver FD handling is messed up in some way. 199 # Savannah bug #28189 200 # It doesn't look like that bug anymore but this is the code it runs 201 202 run_make_test(q! 203 ifdef EXTRA 204 vpath %.dst / 205 xxx.dst: ; true 206 yyy.dst: ; true 207 endif 208 209 M := $(MAKE) 210 xx: ; $M --no-print-directory -j2 -f $(MAKEFILE_LIST) xxx.dst yyy.dst EXTRA=1 211 !, 212 '-j2', 213 '#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode. 214 true 215 true 216 '); 217 } 174 '--no-print-directory -j2', "touch file3"); 175 176 rmfiles('file1', 'file2', 'file3', 'file4'); 218 177 219 178 # Make sure that all jobserver FDs are closed if we need to re-exec the … … 253 212 254 213 1; 214 215 ### Local Variables: 216 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 217 ### End: -
vendor/gnumake/current/tests/scripts/features/patspecific_vars
r2596 r3138 82 82 b%: pattern := good $$t 83 83 84 global := or ginal $$t84 global := original $$t 85 85 86 86 … … 104 104 endif 105 105 106 %z: ; @echo \'patt rn: $a;\'106 %z: ; @echo \'pattern: $a;\' 107 107 108 108 … … 110 110 ', 111 111 '', 112 'normal: global: or ginal $t pattern: inherit: ;113 patt rn: global: orginal $t pattern: inherit: ;');112 'normal: global: original $t pattern: inherit: ; 113 pattern: global: original $t pattern: inherit: ;'); 114 114 115 115 … … 119 119 'rec=1', 120 120 'normal: global: new $t pattern: good $t inherit: good $t; 121 patt rn: global: new $t pattern: good $t inherit: good $t;');121 pattern: global: new $t pattern: good $t inherit: good $t;'); 122 122 123 123 # TEST #8: override in pattern-specific variables -
vendor/gnumake/current/tests/scripts/features/patternrules
r2596 r3138 111 111 ', 112 112 "dir=$dir", 113 "#MAKE#: *** [ $dir/foo.bar] Error 1",113 "#MAKE#: *** [#MAKEFILE#:6: $dir/foo.bar] Error 1", 114 114 512); 115 115 … … 204 204 !, 205 205 'foo.tex', 206 "#MAKE#: *** No rule to make target `foo.tex'. Stop.", 512);206 "#MAKE#: *** No rule to make target 'foo.tex'. Stop.", 512); 207 207 208 208 unlink(@f); … … 223 223 # This tells the test driver that the perl test script executed properly. 224 224 1; 225 226 ### Local Variables: 227 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 228 ### End: -
vendor/gnumake/current/tests/scripts/features/recursion
r2596 r3138 19 19 ('CFLAGS=-O -w' . ($parallel_jobs ? ' -j 2' : '')), 20 20 ($vos 21 ? "#MAKE#: Entering directory `#PWD#'21 ? "#MAKE#: Entering directory '#PWD#' 22 22 make 'CFLAGS=-O' -f #MAKEFILE# foo 23 23 make CFLAGS=-O … … 27 27 MAKELEVEL = 0 28 28 THE END 29 #MAKE#: Leaving directory `#PWD#'"30 : "#MAKE#: Entering directory `#PWD#'29 #MAKE#: Leaving directory '#PWD#'" 30 : "#MAKE#: Entering directory '#PWD#' 31 31 #MAKEPATH# -f #MAKEFILE# foo 32 #MAKE#[1]: Entering directory `#PWD#'32 #MAKE#[1]: Entering directory '#PWD#' 33 33 #MAKEPATH# 34 34 MAKELEVEL = 1 35 35 #MAKEPATH# -f #MAKEFILE# last 36 #MAKE#[2]: Entering directory `#PWD#'36 #MAKE#[2]: Entering directory '#PWD#' 37 37 #MAKEPATH# 38 38 MAKELEVEL = 2 39 39 THE END 40 #MAKE#[2]: Leaving directory `#PWD#'41 #MAKE#[1]: Leaving directory `#PWD#'42 #MAKE#: Leaving directory `#PWD#'"));40 #MAKE#[2]: Leaving directory '#PWD#' 41 #MAKE#[1]: Leaving directory '#PWD#' 42 #MAKE#: Leaving directory '#PWD#'")); 43 43 44 44 -
vendor/gnumake/current/tests/scripts/features/reinvoke
r2596 r3138 58 58 # including: this and the previous one test different parts of the code. 59 59 60 run_make_test(undef, "F=b", "[ -f b ] || echo >> b\nhello\n")60 run_make_test(undef, 'F=b', "[ -f b ] || echo >> b\nhello\n") 61 61 62 62 &rmfiles('a','b','c'); 63 63 64 # Ensure command line variables are preserved properly across re-exec 65 # Tests for Savannah bug #30723 66 67 run_make_test(' 68 ifdef RECURSE 69 -include foo30723 70 endif 71 recurse: ; @$(MAKE) -f $(MAKEFILE_LIST) RECURSE=1 test 72 test: ; @echo F.O=$(F.O) 73 foo30723: ; @touch $@ 74 ', 75 '--no-print-directory F.O=bar', "F.O=bar\n"); 76 77 unlink('foo30723'); 78 64 79 # This tells the test driver that the perl test script executed properly. 65 80 1; -
vendor/gnumake/current/tests/scripts/features/se_explicit
r2596 r3138 6 6 # TEST #0: Test handing of '$' in prerequisites with and without second 7 7 # expansion. 8 9 # If we don't support archives then the prerequisite is different 10 my $prereq = exists $FEATURES{'archives'} ? '$' : '$(PRE)'; 8 11 9 12 run_make_test(q! … … 19 22 !, 20 23 '', 21 " \$\nbar\$biz\nfoo\$bar : bar\$baz bar\$biz");24 "$prereq\nbar\$biz\nfoo\$bar : bar\$baz bar\$biz"); 22 25 23 26 run_make_test(undef, 'SE=1', "three\nfour\nbariz\nfoo\$bar : baraz bariz"); … … 116 119 all : $$(eval $$(info test)) 117 120 !, 118 '', "test\n#MAKE#: Nothing to be done for `all'.\n");121 '', "test\n#MAKE#: Nothing to be done for 'all'.\n"); 119 122 120 123 # TEST #5: (NEGATIVE) catch eval in a prereq list trying to create new … … 153 156 154 157 155 # This tells the test driver that the perl test script executed properly. 158 # Allow patsubst shorthand in second expansion context. 159 # Requires the colon to be quoted. Savannah bug #16545 160 run_make_test(q! 161 .PHONY: foo.bar 162 .SECONDEXPANSION: 163 foo: $$(@\\:%=%.bar); @echo '$^' 164 !, 165 '', "foo.bar\n"); 166 156 167 1; -
vendor/gnumake/current/tests/scripts/features/se_implicit
r2596 r3138 223 223 '', "\n"); 224 224 225 # Test #10: Test second expansion with second expansion prerequisites 226 # Ensures pattern_search() recurses with SE prereqs. 227 touch('a'); 228 run_make_test(q! 229 .SECONDEXPANSION: 230 sim_base_rgg := just_a_name 231 sim_base_src := a 232 sim_base_f := a a a 233 sim_%.f: $${sim_$$*_f} 234 echo $@ 235 sim_%.src: $${sim_$$*_src} 236 echo $@ 237 sim_%: \ 238 $$(if $$(sim_$$*_src),sim_%.src) \ 239 $$(if $$(sim_$$*_f),sim_%.f) \ 240 $$(if $$(sim_$$*_rgg),$$(sim_$$*_rgg).s) 241 echo $@ 242 !, 243 '-s sim_base', "#MAKE#: *** No rule to make target 'sim_base'. Stop.", 512); 244 245 unlink('a'); 246 247 # Ensure that order-only tokens embedded in second expansions are parsed 248 run_make_test(q! 249 .SECONDEXPANSION: 250 PREREQS=p1|p2 251 P2=p2 252 all : foo bar 253 f%o: $$(PREREQS) ; @echo '$@' from '$^' and '$|' 254 b%r: p1|$$(P2) ; @echo '$@' from '$^' and '$|' 255 p% : ; : $@ 256 !, 257 "", ": p1\n: p2\nfoo from p1 and p2\nbar from p1 and p2\n"); 258 225 259 # This tells the test driver that the perl test script executed properly. 226 260 1; -
vendor/gnumake/current/tests/scripts/features/targetvars
r2596 r3138 238 238 run_make_test(undef, 'FOO=C', "C f1\n"); 239 239 240 # TEST #19: Conditional variables with command-line settings 241 242 run_make_test(' 243 a: FOO ?= f1 244 a: ; @echo "$(FOO)" 245 ', 246 '', "f1\n"); 247 248 run_make_test(undef, 'FOO=C', "C\n"); 249 240 250 # TEST #20: Check for continuation after semicolons 241 251 242 252 run_make_test(q! 243 a: A = 'hello; \253 a: A = 'hello;\ 244 254 world' 245 255 a: ; @echo $(A) -
vendor/gnumake/current/tests/scripts/features/varnesting
r2596 r3138 1 $description = "The following test creates a makefile to ..."; 1 # -*-perl-*- 2 $description = "Test recursive variables"; 2 3 3 4 $details = ""; 4 5 5 open(MAKEFILE,"> $makefile"); 6 run_make_test(' 7 x = variable1 8 variable2 := Hello 9 y = $(subst 1,2,$(x)) 10 z = y 11 a := $($($(z))) 12 all: 13 @echo $(a) 14 ', 15 '', "Hello\n"); 6 16 7 # The Contents of the MAKEFILE ... 17 # This tests resetting the value of a variable while expanding it. 18 # You may only see problems with this if you're using valgrind or 19 # some other memory checker that poisons freed memory. 20 # See Savannah patch #7534 8 21 9 print MAKEFILE "x = variable1\n" 10 ."variable2 := Hello\n" 11 ."y = \$(subst 1,2,\$(x))\n" 12 ."z = y\n" 13 ."a := \$(\$(\$(z)))\n" 14 ."all: \n" 15 ."\t\@echo \$(a)\n"; 16 17 # END of Contents of MAKEFILE 18 19 close(MAKEFILE); 20 21 &run_make_with_options($makefile,"",&get_logfile); 22 23 # Create the answer to what should be produced by this Makefile 24 $answer = "Hello\n"; 25 26 &compare_output($answer,&get_logfile(1)); 22 run_make_test(' 23 VARIABLE = $(eval VARIABLE := echo hi)$(VARIABLE) 24 wololo: 25 @$(VARIABLE) 26 ', 27 '', "hi\n"); 27 28 28 29 1; -
vendor/gnumake/current/tests/scripts/features/vpath
r2596 r3138 75 75 vpath-d/fail.te: 76 76 !, 77 '', "#MAKE#: Nothing to be done for `default'.\n");77 '', "#MAKE#: Nothing to be done for 'default'.\n"); 78 78 79 79 rmdir('vpath-d'); -
vendor/gnumake/current/tests/scripts/features/vpath3
r2596 r3138 1 # -*-perl-*-1 # -*-perl-*- 2 2 3 3 $description = "Test the interaction of the -lfoo feature and vpath"; 4 4 $details = ""; 5 5 6 open(MAKEFILE,"> $makefile"); 6 my @dirs_to_make = qw(a1 b1 a2 b2 b3); 7 for my $d (@dirs_to_make) { 8 mkdir($d, 0777); 9 } 7 10 8 # The Contents of the MAKEFILE ... 9 10 print MAKEFILE "vpath %.a a1\n"; 11 print MAKEFILE "vpath %.so b1\n"; 12 print MAKEFILE "vpath % a2 b2\n"; 13 print MAKEFILE "vpath % b3\n"; 14 print MAKEFILE "all: -l1 -l2 -l3; \@echo \$^\n"; 15 16 # END of Contents of MAKEFILE 17 18 close(MAKEFILE); 19 20 mkdir("a1", 0777); 21 mkdir("b1", 0777); 22 mkdir("a2", 0777); 23 mkdir("b2", 0777); 24 mkdir("b3", 0777); 25 26 @files_to_touch = ("a1${pathsep}lib1.a", 27 "b1${pathsep}lib1.so", 28 "a2${pathsep}lib2.a", 29 "b2${pathsep}lib2.so", 30 "lib3.a", 31 "b3${pathsep}lib3.so"); 32 11 my @files_to_touch = ("a1${pathsep}lib1.a", 12 "a1${pathsep}libc.a", 13 "b1${pathsep}lib1.so", 14 "a2${pathsep}lib2.a", 15 "b2${pathsep}lib2.so", 16 "lib3.a", 17 "b3${pathsep}lib3.so"); 33 18 &touch(@files_to_touch); 34 19 35 &run_make_with_options($makefile,"",&get_logfile); 20 my $answer = "a1${pathsep}lib1.a a1${pathsep}libc.a " . 21 "a2${pathsep}lib2.a lib3.a\n"; 22 if ($port_type eq 'VMS-DCL') { 23 $answer =~ s/ /,/g; 24 } 36 25 37 # Create the answer to what should be produced by this Makefile 38 $answer = "a1${pathsep}lib1.a a2${pathsep}lib2.a lib3.a\n"; 26 run_make_test(' 27 vpath %.h b3 28 vpath %.a a1 29 vpath %.so b1 30 vpath % a2 b2 31 vpath % b3 32 all: -l1 -lc -l2 -l3; @echo $^ 33 ', 34 '', $answer); 39 35 40 if (&compare_output($answer,&get_logfile(1))) 41 { 42 unlink @files_to_touch; 43 rmdir("a1"); 44 rmdir("b1"); 45 rmdir("a2"); 46 rmdir("b2"); 47 rmdir("b3"); 36 unlink(@files_to_touch); 37 for my $d (@dirs_to_make) { 38 rmdir($d); 48 39 } 49 40 -
vendor/gnumake/current/tests/scripts/features/vpathgpath
r2596 r3138 58 58 push(@touchedfiles, "bar.c"); 59 59 60 $answer = "$make_name: Nothing to be done for `general'.\n";60 $answer = "$make_name: Nothing to be done for 'general'.\n"; 61 61 62 62 &compare_output($answer,&get_logfile(1)); -
vendor/gnumake/current/tests/scripts/features/vpathplus
r2596 r3138 87 87 $answer = "not creating notarget.c from notarget.d 88 88 cat notarget.c > notarget.b 2>/dev/null || exit 1 89 $make_name: *** [ notarget.b] Error 189 $make_name: *** [$makefile:16: notarget.b] Error 1 90 90 "; 91 91 … … 127 127 128 128 1; 129 130 ### Local Variables: 131 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 132 ### End: -
vendor/gnumake/current/tests/scripts/functions/call
r2596 r3138 5 5 results.\n"; 6 6 7 open(MAKEFILE, "> $makefile"); 8 9 # The Contents of the MAKEFILE ... 10 11 print MAKEFILE <<'EOMAKE'; 7 run_make_test(q! 12 8 # Simple, just reverse two things 13 9 # 14 10 reverse = $2 $1 15 11 16 # A complex `map' function, using recursive `call'.12 # A complex 'map' function, using recursive 'call'. 17 13 # 18 14 map = $(foreach a,$2,$(call $1,$a)) … … 39 35 DEP_baz = quux blarp 40 36 rest = $(wordlist 2,$(words ${1}),${1}) 41 tclose = $(if $1,$(firstword $1) \37 tclose = $(if $1,$(firstword $1)\ 42 38 $(call tclose,$(sort ${DEP_$(firstword $1)} $(call rest,$1)))) 43 39 … … 49 45 echo '$(call my-if,a,b,c)'; \ 50 46 echo '$(call two,bar,baz)'; \ 51 echo '$(call tclose,foo)' 47 echo '$(call tclose,foo)'; 48 !, 49 "", "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\nfoo bar baz blarp quux \n"); 52 50 53 54 55 EOMAKE 56 57 # These won't work until/unless PR/1527 is resolved. 58 # echo '$(call my-foreach,a,x y z,$(a)$(a))'; \ 59 # echo '$(call my-if,,$(warning don't print this),ok)' 51 # These won't work because call expands all its arguments first, before 52 # passing them on, then marks them as resolved/simple, so they're not 53 # expanded again by the function. 60 54 # 61 # $answer = "xx yy zz\nok\n"; 62 63 # END of Contents of MAKEFILE 64 65 close(MAKEFILE); 66 67 &run_make_with_options($makefile, "", &get_logfile); 68 $answer = "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\nfoo bar baz blarp quux \n"; 69 &compare_output($answer, &get_logfile(1)); 70 55 # echo '$(call my-foreach,a,x y z,$$(a)$$(a))'; \ 56 # echo '$(call my-if,,$$(info don't print this),$$(info do print this))' 57 # 58 # $answer = "xx yy zz\ndo print this\n"; 71 59 72 60 # TEST eclipsing of arguments when invoking sub-calls 73 61 74 $makefile2 = &get_tmpfile; 75 76 open(MAKEFILE,"> $makefile2"); 77 78 print MAKEFILE <<'EOF'; 79 62 run_make_test(q! 80 63 all = $1 $2 $3 $4 $5 $6 $7 $8 $9 81 64 … … 89 72 @echo $(call level2,1,2,3,4,5,6,7,8) 90 73 @echo $(call level3,1,2,3,4,5,6,7,8) 91 EOF 74 !, 75 "", "1 2 3 4 5 6 7 8 9\n1 2 3 4 5\n1 2 3\n1 2 3\n"); 92 76 93 close(MAKEFILE); 77 # Ensure that variables are defined in global scope even in a $(call ...) 94 78 95 &run_make_with_options($makefile2, "", &get_logfile); 96 $answer = "1 2 3 4 5 6 7 8 9\n1 2 3 4 5\n1 2 3\n1 2 3\n"; 97 &compare_output($answer,&get_logfile(1)); 79 delete $ENV{X123}; 80 81 run_make_test(' 82 tst = $(eval export X123) 83 $(call tst) 84 all: ; @echo "$${X123-not set}" 85 ', 86 '', "\n"); 98 87 99 88 1; 89 90 ### Local Variables: 91 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 92 ### End: -
vendor/gnumake/current/tests/scripts/functions/error
r2596 r3138 55 55 56 56 &run_make_with_options($makefile, "ERROR4=definitely", &get_logfile, 512); 57 $answer = "Some stuff\n$makefile:1 6: *** error is definitely. Stop.\n";57 $answer = "Some stuff\n$makefile:17: *** error is definitely. Stop.\n"; 58 58 &compare_output($answer,&get_logfile(1)); 59 59 … … 67 67 1; 68 68 69 70 71 72 73 69 ### Local Variables: 70 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 71 ### End: -
vendor/gnumake/current/tests/scripts/functions/filter-out
r2596 r3138 1 1 # -*-perl-*- 2 2 3 $description = "Test the filter -out function.";3 $description = "Test the filter and filter-out functions."; 4 4 5 5 $details = "The makefile created in this test has two variables. The … … 12 12 functions is the same single .elc name.\n"; 13 13 14 open(MAKEFILE,"> $makefile"); 14 # Basic test -- filter 15 run_make_test(q! 16 files1 := $(filter %.o, foo.elc bar.o lose.o) 17 files2 := $(filter %.o foo.i, foo.i bar.i lose.i foo.elc bar.o lose.o) 18 all: ; @echo '$(files1) $(files2)' 19 !, 20 '', "bar.o lose.o foo.i bar.o lose.o\n"); 15 21 16 print MAKEFILE <<'EOF'; 22 # Basic test -- filter-out 23 run_make_test(q! 17 24 files1 := $(filter-out %.o, foo.elc bar.o lose.o) 18 25 files2 := $(filter-out foo.i bar.i lose.i %.o, foo.i bar.i lose.i foo.elc bar.o lose.o) 19 all: ; @echo $(files1) $(files2) 20 EOF 26 all: ; @echo '$(files1) $(files2)' 27 !, 28 '', "foo.elc foo.elc\n"); 21 29 22 close(MAKEFILE); 30 # Escaped patterns 31 run_make_test(q!all:;@echo '$(filter foo\%bar,foo%bar fooXbar)'!, 32 '', "foo%bar\n"); 23 33 24 &run_make_with_options($makefile, "", &get_logfile, 0); 25 $answer = "foo.elc foo.elc\n"; 26 &compare_output($answer,&get_logfile(1)); 34 run_make_test(q!all:;@echo '$(filter foo\%\%\\\\\%\%bar,foo%%\\%%bar fooX\\Ybar)'!, 35 '', "foo%%\\%%bar\n"); 36 37 run_make_test(q! 38 X = $(filter foo\\\\\%bar,foo\%bar foo\Xbar) 39 all:;@echo '$(X)'!, 40 '', "foo\\%bar\n"); 27 41 28 42 1; -
vendor/gnumake/current/tests/scripts/functions/foreach
r2596 r3138 1 1 # -*-perl-*- 2 # $Id : foreach,v 1.5 2006/03/10 02:20:46 psmith Exp$2 # $Id$ 3 3 4 4 $description = "Test the foreach function."; … … 54 54 'FOREACH'); 55 55 56 # Allow variable names with trailing space 57 run_make_test(q! 58 $(foreach \ 59 a \ 60 , b c d \ 61 , $(info $a)) 62 all:;@: 63 !, 64 "", "b\nc\nd\n"); 56 65 57 # TEST 2: Check some error conditions. 66 # Allow empty variable names. We still expand the body. 67 68 run_make_test(' 69 x = $(foreach ,1 2 3,a) 70 y := $x 71 72 all: ; @echo $y', 73 '', "a a a\n"); 74 75 # Check some error conditions. 58 76 59 77 run_make_test(' … … 63 81 all: ; @echo $y', 64 82 '', 65 "#MAKEFILE#:2: *** insufficient number of arguments (1) to function `foreach'. Stop.",83 "#MAKEFILE#:2: *** insufficient number of arguments (1) to function 'foreach'. Stop.", 66 84 512); 67 85 68 86 run_make_test(' 69 x = $(foreach )87 x = $(foreach x,y) 70 88 y := $x 71 89 72 90 all: ; @echo $y', 73 91 '', 74 "#MAKEFILE#:2: *** insufficient number of arguments ( 1) to function `foreach'. Stop.",92 "#MAKEFILE#:2: *** insufficient number of arguments (2) to function 'foreach'. Stop.", 75 93 512); 76 94 -
vendor/gnumake/current/tests/scripts/functions/shell
r2596 r3138 5 5 $details = ''; 6 6 7 # Test standard shell 8 run_make_test('.PHONY: all 9 OUT := $(shell echo hi) 10 all: ; @echo $(OUT) 11 ','','hi'); 7 12 8 13 # Test shells inside rules. 9 14 run_make_test('.PHONY: all 10 15 all: ; @echo $(shell echo hi) 11 ','','hi'); 16 ','','hi'); 17 18 # Verify .SHELLSTATUS 19 run_make_test('.PHONY: all 20 PRE := $(.SHELLSTATUS) 21 $(shell exit 0) 22 OK := $(.SHELLSTATUS) 23 $(shell exit 1) 24 BAD := $(.SHELLSTATUS) 25 all: ; @echo PRE=$(PRE) OK=$(OK) BAD=$(BAD) 26 ','','PRE= OK=0 BAD=1'); 12 27 13 28 … … 28 43 .PHONY: all 29 44 all: ; @echo $$HI 30 ','','hi'); 45 ','','hi'); 46 47 # Test shell errors in recipes including offset 48 run_make_test(' 49 all: 50 @echo hi 51 $(shell ./basdfdfsed there) 52 @echo there 53 ', 54 '', "#MAKE#: ./basdfdfsed: Command not found\nhi\nthere\n"); 31 55 32 56 1; 57 58 ### Local Variables: 59 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 60 ### End: -
vendor/gnumake/current/tests/scripts/functions/sort
r2596 r3138 1 $description = "The following test creates a makefile to verify\n" 2 ."the ability of make to sort lists of object. Sort\n" 3 ."will also remove any duplicate entries. This will also\n" 4 ."be tested."; 1 # -*-perl-*- 5 2 6 $details = "The make file is built with a list of object in a random order\n" 7 ."and includes some duplicates. Make should sort all of the elements\n" 8 ."remove all duplicates\n"; 3 $description = "The following test creates a makefile to verify 4 the ability of make to sort lists of object. Sort 5 will also remove any duplicate entries. This will also 6 be tested."; 9 7 10 open(MAKEFILE,"> $makefile"); 8 $details = "The make file is built with a list of object in a random order 9 and includes some duplicates. Make should sort all of the elements 10 remove all duplicates\n"; 11 11 12 # The Contents of the MAKEFILE ... 13 14 print MAKEFILE "foo := moon_light days \n" 15 ."foo1:= jazz\n" 16 ."bar := captured \n" 17 ."bar2 = boy end, has rise A midnight \n" 18 ."bar3:= \$(foo)\n" 19 ."s1 := _by\n" 20 ."s2 := _and_a\n" 21 ."t1 := \$(addsuffix \$(s1), \$(bar) )\n" 22 ."t2 := \$(addsuffix \$(s2), \$(foo1) )\n" 23 ."t3 := \$(t2) \$(t2) \$(t2) \$(t2) \$(t2) \$(t2) \$(t2) \$(t2) \$(t2) \$(t2) \n" 24 ."t4 := \$(t3) \$(t3) \$(t3) \$(t3) \$(t3) \$(t3) \$(t3) \$(t3) \$(t3) \$(t3) \n" 25 ."t5 := \$(t4) \$(t4) \$(t4) \$(t4) \$(t4) \$(t4) \$(t4) \$(t4) \$(t4) \$(t4) \n" 26 ."t6 := \$(t5) \$(t5) \$(t5) \$(t5) \$(t5) \$(t5) \$(t5) \$(t5) \$(t5) \$(t5) \n" 27 ."t7 := \$(t6) \$(t6) \$(t6) \n" 28 ."p1 := \$(addprefix \$(foo1), \$(s2) )\n" 29 ."blank:= \n" 30 ."all:\n" 31 ."\t\@echo \$(sort \$(bar2) \$(foo) \$(addsuffix \$(s1), \$(bar) ) \$(t2) \$(bar2) \$(bar3))\n" 32 ."\t\@echo \$(sort \$(blank) \$(foo) \$(bar2) \$(t1) \$(p1) )\n" 33 ."\t\@echo \$(sort \$(foo) \$(bar2) \$(t1) \$(t4) \$(t5) \$(t7) \$(t6) )\n"; 12 run_make_test(' 13 foo := moon_light days 14 foo1:= jazz 15 bar := captured 16 bar2 = boy end, has rise A midnight 17 bar3:= $(foo) 18 s1 := _by 19 s2 := _and_a 20 t1 := $(addsuffix $(s1), $(bar) ) 21 t2 := $(addsuffix $(s2), $(foo1) ) 22 t3 := $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) 23 t4 := $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) 24 t5 := $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) 25 t6 := $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) 26 t7 := $(t6) $(t6) $(t6) 27 p1 := $(addprefix $(foo1), $(s2) ) 28 blank:= 29 all: 30 @echo $(sort $(bar2) $(foo) $(addsuffix $(s1), $(bar) ) $(t2) $(bar2) $(bar3)) 31 @echo $(sort $(blank) $(foo) $(bar2) $(t1) $(p1) ) 32 @echo $(sort $(foo) $(bar2) $(t1) $(t4) $(t5) $(t7) $(t6) ) 33 ', 34 '', 'A boy captured_by days end, has jazz_and_a midnight moon_light rise 35 A boy captured_by days end, has jazz_and_a midnight moon_light rise 36 A boy captured_by days end, has jazz_and_a midnight moon_light rise 37 '); 34 38 35 39 36 # END of Contents of MAKEFILE 40 # Test with non-space/tab whitespace. Note that you can't see the 41 # original bug except using valgrind. 37 42 38 close(MAKEFILE); 39 40 &run_make_with_options($makefile,"",&get_logfile); 41 42 # Create the answer to what should be produced by this Makefile 43 $answer = "A boy captured_by days end, has jazz_and_a midnight moon_light rise\n" 44 ."A boy captured_by days end, has jazz_and_a midnight moon_light rise\n" 45 ."A boy captured_by days end, has jazz_and_a midnight moon_light rise\n"; 46 47 &compare_output($answer,&get_logfile(1)); 43 run_make_test("FOO = a b\tc\rd\fe \f \f \f \f \ff 44 all: ; \@echo \$(words \$(sort \$(FOO)))\n", 45 '', "6\n"); 48 46 49 47 1; 50 48 51 52 53 54 55 49 ### Local Variables: 50 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 51 ### End: -
vendor/gnumake/current/tests/scripts/functions/warning
r2596 r3138 53 53 54 54 &run_make_with_options($makefile, "WARNING4=definitely", &get_logfile, 0); 55 $answer = "Some stuff\n$makefile:1 4: warning is definitely\nhi\nthere\n";55 $answer = "Some stuff\n$makefile:15: warning is definitely\nhi\nthere\n"; 56 56 &compare_output($answer,&get_logfile(1)); 57 58 # Test linenumber offset 59 60 run_make_test(q! 61 all: one two 62 $(warning in $@ line 3) 63 @true 64 $(warning in $@ line 5) 65 66 one two: 67 $(warning in $@ line 8) 68 @true 69 $(warning in $@ line 10) 70 !, 71 '', "#MAKEFILE#:8: in one line 8 72 #MAKEFILE#:10: in one line 10 73 #MAKEFILE#:8: in two line 8 74 #MAKEFILE#:10: in two line 10 75 #MAKEFILE#:3: in all line 3 76 #MAKEFILE#:5: in all line 5\n"); 57 77 58 78 # This tells the test driver that the perl test script executed properly. 59 79 1; 60 80 61 62 63 64 65 81 ### Local Variables: 82 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 83 ### End: -
vendor/gnumake/current/tests/scripts/functions/wildcard
r2596 r3138 89 89 '', "\n"); 90 90 91 # TEST #5: wildcard used to verify file existence 92 93 touch('xxx.yyy'); 94 95 run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!, 96 '', "file=xxx.yyy\n"); 97 98 unlink('xxx.yyy'); 99 100 run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!, 101 '', "file=\n"); 102 91 103 1; -
vendor/gnumake/current/tests/scripts/functions/word
r2596 r3138 57 57 wordlist-e3: ; @echo $(wordlist 1, 12a ,$(FOO))', 58 58 'word-e1', 59 "#MAKEFILE#:3: *** non-numeric first argument to `word' function: ''. Stop.",59 "#MAKEFILE#:3: *** non-numeric first argument to 'word' function: ''. Stop.", 60 60 512); 61 61 62 62 run_make_test(undef, 63 63 'word-e2', 64 "#MAKEFILE#:4: *** non-numeric first argument to `word' function: 'abc '. Stop.",64 "#MAKEFILE#:4: *** non-numeric first argument to 'word' function: 'abc '. Stop.", 65 65 512); 66 66 67 67 run_make_test(undef, 68 68 'word-e3', 69 "#MAKEFILE#:5: *** non-numeric first argument to `word' function: '1a'. Stop.",69 "#MAKEFILE#:5: *** non-numeric first argument to 'word' function: '1a'. Stop.", 70 70 512); 71 71 72 72 run_make_test(undef, 73 73 'wordlist-e1', 74 "#MAKEFILE#:7: *** non-numeric first argument to `wordlist' function: ''. Stop.",74 "#MAKEFILE#:7: *** non-numeric first argument to 'wordlist' function: ''. Stop.", 75 75 512); 76 76 77 77 run_make_test(undef, 78 78 'wordlist-e2', 79 "#MAKEFILE#:8: *** non-numeric first argument to `wordlist' function: 'abc '. Stop.",79 "#MAKEFILE#:8: *** non-numeric first argument to 'wordlist' function: 'abc '. Stop.", 80 80 512); 81 81 82 82 run_make_test(undef, 83 83 'wordlist-e3', 84 "#MAKEFILE#:9: *** non-numeric second argument to `wordlist' function: ' 12a '. Stop.",84 "#MAKEFILE#:9: *** non-numeric second argument to 'wordlist' function: ' 12a '. Stop.", 85 85 512); 86 86 … … 95 95 wordlist-e: ; @echo $(WL)', 96 96 'word-e x=', 97 "#MAKEFILE#:3: *** non-numeric first argument to `word' function: ''. Stop.",97 "#MAKEFILE#:3: *** non-numeric first argument to 'word' function: ''. Stop.", 98 98 512); 99 99 100 100 run_make_test(undef, 101 101 'word-e x=abc', 102 "#MAKEFILE#:3: *** non-numeric first argument to `word' function: 'abc'. Stop.",102 "#MAKEFILE#:3: *** non-numeric first argument to 'word' function: 'abc'. Stop.", 103 103 512); 104 104 105 105 run_make_test(undef, 106 106 'word-e x=0', 107 "#MAKEFILE#:3: *** first argument to `word' function must be greater than 0. Stop.",107 "#MAKEFILE#:3: *** first argument to 'word' function must be greater than 0. Stop.", 108 108 512); 109 109 110 110 run_make_test(undef, 111 111 'wordlist-e s= e=', 112 "#MAKEFILE#:4: *** non-numeric first argument to `wordlist' function: ''. Stop.",112 "#MAKEFILE#:4: *** non-numeric first argument to 'wordlist' function: ''. Stop.", 113 113 512); 114 114 115 115 run_make_test(undef, 116 116 'wordlist-e s=abc e=', 117 "#MAKEFILE#:4: *** non-numeric first argument to `wordlist' function: 'abc'. Stop.",117 "#MAKEFILE#:4: *** non-numeric first argument to 'wordlist' function: 'abc'. Stop.", 118 118 512); 119 119 120 120 run_make_test(undef, 121 121 'wordlist-e s=4 e=12a', 122 "#MAKEFILE#:4: *** non-numeric second argument to `wordlist' function: '12a'. Stop.",122 "#MAKEFILE#:4: *** non-numeric second argument to 'wordlist' function: '12a'. Stop.", 123 123 512); 124 124 125 125 run_make_test(undef, 126 126 'wordlist-e s=0 e=12', 127 "#MAKEFILE#:4: *** invalid first argument to `wordlist' function: `0'. Stop.",127 "#MAKEFILE#:4: *** invalid first argument to 'wordlist' function: '0'. Stop.", 128 128 512); 129 129 -
vendor/gnumake/current/tests/scripts/misc/general3
r2596 r3138 27 27 28 28 \$(STR) \$(TAB)", 29 '', "#MAKE#: Nothing to be done for `all'.");29 '', "#MAKE#: Nothing to be done for 'all'."); 30 30 31 31 # TEST 2 … … 311 311 foo bar'); 312 312 313 run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#:1: x] Error 1 (ignored)\n"); 314 313 315 1; -
vendor/gnumake/current/tests/scripts/options/dash-B
r2596 r3138 23 23 '', 'cp bar.x foo'); 24 24 25 run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");25 run_make_test(undef, '', "#MAKE#: Nothing to be done for 'all'."); 26 26 run_make_test(undef, '-B', 'cp bar.x foo'); 27 27 … … 29 29 30 30 utouch(1000, 'foo'); 31 run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");31 run_make_test(undef, '', "#MAKE#: Nothing to be done for 'all'."); 32 32 run_make_test(undef, '-B', 'cp bar.x foo'); 33 33 … … 46 46 ', 47 47 '-B', 'MAKE_RESTARTS= 48 #MAKEFILE#:4: foo.x: No such file or directory49 48 MAKE_RESTARTS=1'); 50 49 … … 64 63 ', 65 64 '-B', 'MAKE_RESTARTS= 66 #MAKEFILE#:4: foo.x: No such file or directory67 65 MAKE_RESTARTS=1 68 66 blah.x … … 84 82 85 83 1; 84 85 ### Local Variables: 86 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 87 ### End: -
vendor/gnumake/current/tests/scripts/options/dash-C
r2596 r3138 35 35 36 36 # Create the answer to what should be produced by this Makefile 37 $answer = "$make_name: Entering directory `$wpath'\n"37 $answer = "$make_name: Entering directory '$wpath'\n" 38 38 . "$delete_command EXAMPLE\n" 39 . "$make_name: Leaving directory `$wpath'\n";39 . "$make_name: Leaving directory '$wpath'\n"; 40 40 41 41 &compare_output($answer,&get_logfile(1)); … … 63 63 64 64 # Create the answer to what should be produced by this Makefile 65 $answer = "$make_name: Entering directory `$wpath'\n"65 $answer = "$make_name: Entering directory '$wpath'\n" 66 66 . "$delete_command EXAMPLEslash\n" 67 . "$make_name: Leaving directory `$wpath'\n";67 . "$make_name: Leaving directory '$wpath'\n"; 68 68 69 69 &compare_output($answer,&get_logfile(1)); -
vendor/gnumake/current/tests/scripts/options/dash-I
r2596 r3138 52 52 53 53 $answer = "$mkpath ANOTHER -f $makefile 54 ${make_name}[1]: Entering directory `$pwd'54 ${make_name}[1]: Entering directory '$pwd' 55 55 This is another included makefile 56 ${make_name}[1]: Leaving directory `$pwd'\n";56 ${make_name}[1]: Leaving directory '$pwd'\n"; 57 57 58 58 &run_make_with_options($makefile,"-I $workdir recurse",&get_logfile); -
vendor/gnumake/current/tests/scripts/options/dash-W
r2596 r3138 13 13 # Run it again: nothing should happen 14 14 15 run_make_test(undef, '', "#MAKE#: `a.x' is up to date.");15 run_make_test(undef, '', "#MAKE#: 'a.x' is up to date."); 16 16 17 17 # Now run it with -W b.x: should rebuild a.x … … 22 22 23 23 utouch(1000, 'a.x'); 24 run_make_test(undef, '', "#MAKE#: `a.x' is up to date.");24 run_make_test(undef, '', "#MAKE#: 'a.x' is up to date."); 25 25 run_make_test(undef, '-W b.x', 'echo >> a.x'); 26 26 … … 43 43 baz.x: bar.x ; @echo "touch $@" 44 44 ', 45 '', '#MAKEFILE#:3: foo.x: No such file or directory 46 echo >> bar.x 45 '', 'echo >> bar.x 47 46 touch foo.x 48 47 restarts=1 … … 87 86 88 87 1; 88 89 ### Local Variables: 90 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 91 ### End: -
vendor/gnumake/current/tests/scripts/options/dash-k
r2596 r3138 43 43 "$workdir${pathsep}commands.c","$workdir${pathsep}display.c", 44 44 "$workdir${pathsep}buffer.h", 45 "$workdir${pathsep}command.c");45 "$workdir${pathsep}command.c"); 46 46 47 47 &touch(@files_to_touch); … … 58 58 # Create the answer to what should be produced by this Makefile 59 59 $answer = "cc -c main.c 60 $make_name: *** No rule to make target `kbd.c', needed by `kbd.o'.60 $make_name: *** No rule to make target 'kbd.c', needed by 'kbd.o'. 61 61 cc -c commands.c 62 62 cc -c display.c 63 $make_name: Target `edit' not remade because of errors.\n";63 $make_name: Target 'edit' not remade because of errors.\n"; 64 64 65 65 # COMPARE RESULTS … … 93 93 94 94 $answer = "exit 1 95 $make_name: *** [ foo.o] Error 196 $make_name: Target `all' not remade because of errors.\n";95 $make_name: *** [$makefile2:9: foo.o] Error 1 96 $make_name: Target 'all' not remade because of errors.\n"; 97 97 98 98 &compare_output($answer, &get_logfile(1)); … … 107 107 '-k', 108 108 "#MAKEFILE#:2: ifile: No such file or directory 109 #MAKE#: *** No rule to make target `no-such-file', needed by `ifile'.110 #MAKE#: Failed to remake makefile `ifile'.109 #MAKE#: *** No rule to make target 'no-such-file', needed by 'ifile'. 110 #MAKE#: Failed to remake makefile 'ifile'. 111 111 hi\n", 112 112 512); -
vendor/gnumake/current/tests/scripts/options/dash-n
r2596 r3138 4 4 $details = "Try various uses of -n and ensure they all give the correct results.\n"; 5 5 6 open(MAKEFILE, "> $makefile");6 touch('orig'); 7 7 8 # The Contents of the MAKEFILE ... 9 10 print MAKEFILE <<'EOMAKE'; 11 8 run_make_test(q! 12 9 final: intermediate ; echo >> $@ 13 10 intermediate: orig ; echo >> $@ 14 15 EOMAKE 16 17 close(MAKEFILE); 18 19 &touch('orig'); 20 21 # TEST 0 22 23 &run_make_with_options($makefile, "", &get_logfile); 24 $answer = "echo >> intermediate\necho >> final\n"; 25 &compare_output($answer, &get_logfile(1)); 11 !, 12 '', "echo >> intermediate\necho >> final\n"); 26 13 27 14 # TEST 1 28 15 29 &run_make_with_options($makefile, "-Worig -n", &get_logfile); 30 $answer = "echo >> intermediate\necho >> final\n"; 31 &compare_output($answer, &get_logfile(1)); 16 run_make_test(undef, '-Worig -n', "echo >> intermediate\necho >> final\n"); 32 17 33 unlink('orig', 'intermediate', 'final');18 rmfiles(qw(orig intermediate final)); 34 19 35 20 # We consider the actual updated timestamp of targets with all 36 # recursive commands, even with -n. 21 # recursive commands, even with -n. Switching this to the new model 22 # is non-trivial because we use a trick below to change the log content 23 # before we compare it ... 37 24 38 25 $makefile2 = &get_tmpfile; … … 57 44 58 45 &run_make_with_options($makefile2, "", &get_logfile); 59 $answer = "$make_name: `a' is up to date.\n";46 $answer = "$make_name: 'a' is up to date.\n"; 60 47 &compare_output($answer, &get_logfile(1)); 61 48 … … 63 50 64 51 &run_make_with_options($makefile2, "-n", &get_logfile); 65 $answer = "$make_name: `a' is up to date.\n";52 $answer = "$make_name: 'a' is up to date.\n"; 66 53 &compare_output($answer, &get_logfile(1)); 67 54 68 unlink('a', 'b', 'c'); 55 # TEST 4 56 57 unlink(qw(a b)); 58 59 &run_make_with_options($makefile2, "-t -n", &get_logfile); 60 61 open(DASH_N_LOG, ">>" . &get_logfile(1)); 62 print DASH_N_LOG "a exists but should not!\n" if -e 'a'; 63 print DASH_N_LOG "b exists but should not!\n" if -e 'b'; 64 close(DASH_N_LOG); 65 66 &compare_output("touch b\ntouch a\n", &get_logfile(1)); 67 68 # CLEANUP 69 70 unlink(qw(a b c)); 71 72 # Ensure -n continues to be included with recursive/re-execed make 73 # See Savannah bug #38051 74 75 $topmake = &get_tmpfile; 76 $submake = &get_tmpfile; 77 78 open(MAKEFILE, "> $topmake"); 79 print MAKEFILE <<"EOF"; 80 foo: ; \@\$(MAKE) -f "$submake" bar 81 EOF 82 close(MAKEFILE); 83 84 85 # The bar target should print what would happen, but not actually run 86 open(MAKEFILE, "> $submake"); 87 print MAKEFILE <<'EOF'; 88 inc: ; touch $@ 89 -include inc 90 bar: ; @echo $(strip $(MAKEFLAGS)) 91 EOF 92 close(MAKEFILE); 93 94 &run_make_with_options($topmake, '-n --no-print-directory', &get_logfile); 95 $answer = "$make_command -f \"$submake\" bar\ntouch inc\necho n --no-print-directory\n"; 96 &compare_output($answer, &get_logfile(1)); 97 98 unlink('inc'); 69 99 70 100 1; -
vendor/gnumake/current/tests/scripts/options/dash-q
r2596 r3138 6 6 # TEST 0 7 7 8 run_make_test( '8 run_make_test(qq! 9 9 one: 10 10 two: ; 11 11 three: ; : 12 four: ; $(.XY)13 five: ; \ 14 $(.XY)15 six: ; \ 16 $(.XY)17 $(.XY)18 seven: ; \ 19 $(.XY)20 : foo21 $(.XY)22 ',12 four: ; \$(.XY) 13 five: ; \\ 14 \$(.XY) 15 six: ; \\ 16 \$(.XY) 17 \t\$(.XY) 18 seven: ; \\ 19 \$(.XY) 20 \t: foo 21 \t\$(.XY) 22 !, 23 23 '-q one', ''); 24 24 … … 55 55 '-q', '', 256); 56 56 57 # TEST 7 : Savannah bug # 42249 58 # Make sure we exit with 1 even for prerequisite updates 59 run_make_test(' 60 build-stamp: ; echo $@ 61 build-arch: build-stamp 62 build-x: build-arch 63 build-y: build-x 64 ', 65 '-q build-y', '', 256); 66 67 # TEST 8 68 # Make sure we exit with 2 on error even with -q 69 run_make_test(' 70 build-stamp: ; echo $@ 71 build-arch: build-stamp-2 72 build-x: build-arch 73 build-y: build-x 74 ', 75 '-q build-y', "#MAKE#: *** No rule to make target 'build-stamp-2', needed by 'build-arch'. Stop.\n", 512); 76 77 # TEST 9 : Savannah bug # 47151 78 # Make sure we exit with 1 when invoking a recursive make 79 run_make_test(' 80 foo: bar ; echo foo 81 bar: ; @$(MAKE) -f #MAKEFILE# baz 82 baz: ; echo baz 83 ', 84 '-q foo', '', 256); 85 57 86 1; -
vendor/gnumake/current/tests/scripts/options/eval
r2596 r3138 17 17 "eval\neval\nall\nrecurse"); 18 18 19 # Make sure that --eval is handled correctly during restarting 20 run_make_test(q! 21 all: ; @echo $@ 22 -include gen.mk 23 gen.mk: ; @echo > $@ 24 !, 25 '--eval=\$\(info\ eval\)', "eval\neval\nall"); 26 27 unlink('gen.mk'); 28 19 29 1; -
vendor/gnumake/current/tests/scripts/options/symlinks
r2596 r3138 27 27 # With -L, it should update targ 28 28 run_make_test('targ: sym ; @echo make $@ from $<', '', 29 "#MAKE#: `targ' is up to date.");29 "#MAKE#: 'targ' is up to date."); 30 30 run_make_test(undef, '-L', "make targ from sym"); 31 31 … … 37 37 # Now update targ; in all cases targ should be up to date. 38 38 &touch('targ'); 39 run_make_test(undef, '', "#MAKE#: `targ' is up to date.");40 run_make_test(undef, '-L', "#MAKE#: `targ' is up to date.");39 run_make_test(undef, '', "#MAKE#: 'targ' is up to date."); 40 run_make_test(undef, '-L', "#MAKE#: 'targ' is up to date."); 41 41 42 42 # Add in a new link between sym and dep. Be sure it's newer than targ. … … 47 47 # Without -L, nothing should happen 48 48 # With -L, it should update targ 49 run_make_test(undef, '', "#MAKE#: `targ' is up to date.");49 run_make_test(undef, '', "#MAKE#: 'targ' is up to date."); 50 50 run_make_test(undef, '-L', "make targ from sym"); 51 51 … … 57 57 symlink("../$dirname/dep", 'sym'); 58 58 run_make_test('targ: sym ; @echo make $@ from $<', '', 59 "#MAKE#: *** No rule to make target `sym', needed by `targ'. Stop.", 512);59 "#MAKE#: *** No rule to make target 'sym', needed by 'targ'. Stop.", 512); 60 60 61 61 run_make_test('targ: sym ; @echo make $@ from $<', '-L', -
vendor/gnumake/current/tests/scripts/options/warn-undefined-variables
r2596 r3138 19 19 # With --warn-undefined-variables, it should warn me 20 20 run_make_test(undef, '--warn-undefined-variables', 21 "#MAKEFILE#:7: warning: undefined variable `UNDEFINED'22 #MAKEFILE#:9: warning: undefined variable `UNDEFINED'21 "#MAKEFILE#:7: warning: undefined variable 'UNDEFINED' 22 #MAKEFILE#:9: warning: undefined variable 'UNDEFINED' 23 23 ref"); 24 24 -
vendor/gnumake/current/tests/scripts/targets/DEFAULT
r2596 r3138 36 36 37 37 # Create the answer to what should be produced by this Makefile 38 $answer = "${make_name}[1]: Entering directory `$pwd'\n"38 $answer = "${make_name}[1]: Entering directory '$pwd'\n" 39 39 . "Executing rule BAR\n" 40 . "${make_name}[1]: Leaving directory `$pwd'\n";40 . "${make_name}[1]: Leaving directory '$pwd'\n"; 41 41 42 42 # COMPARE RESULTS -
vendor/gnumake/current/tests/scripts/targets/INTERMEDIATE
r2596 r3138 43 43 44 44 &run_make_with_options($makefile,'foo.d',&get_logfile); 45 $answer = "$make_name: `foo.d' is up to date.\n";45 $answer = "$make_name: 'foo.d' is up to date.\n"; 46 46 &compare_output($answer, &get_logfile(1)); 47 47 … … 64 64 65 65 &run_make_with_options($makefile,'foo.c',&get_logfile); 66 $answer = "$make_name: `foo.c' is up to date.\n";66 $answer = "$make_name: 'foo.c' is up to date.\n"; 67 67 &compare_output($answer, &get_logfile(1)); 68 68 -
vendor/gnumake/current/tests/scripts/targets/ONESHELL
r2596 r3138 5 5 $details = ""; 6 6 7 # Some shells (*shakes fist at Solaris*) cannot handle multiple flags in 8 # separate arguments. 9 my $t = `/bin/sh -e -c true 2>/dev/null`; 10 my $multi_ok = $? == 0; 7 11 8 12 # Simple … … 17 21 [ 0"$a" -eq "$$" ] || echo fail 18 22 '); 23 24 # Simple but use multi-word SHELLFLAGS 25 26 if ($multi_ok) { 27 run_make_test(q! 28 .ONESHELL: 29 .SHELLFLAGS = -e -c 30 all: 31 a=$$$$ 32 [ 0"$$a" -eq "$$$$" ] || echo fail 33 !, 34 '', 'a=$$ 35 [ 0"$a" -eq "$$" ] || echo fail 36 '); 37 } 19 38 20 39 # Again, but this time with inner prefix chars -
vendor/gnumake/current/tests/scripts/targets/POSIX
r2596 r3138 1 1 # -*-perl-*- 2 2 3 $description = "Test the behaviour of the .P HONYtarget.";3 $description = "Test the behaviour of the .POSIX target."; 4 4 5 5 $details = ""; … … 18 18 all: ; \@$script 19 19 !, 20 '', "#MAKE#: *** [ all] Error $err\n", 512);20 '', "#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512); 21 21 22 22 # User settings must override .POSIX … … 30 30 '', $out); 31 31 32 # Test the default value of various POSIX-specific variables 33 my %POSIX = (AR => 'ar', ARFLAGS => '-rv', 34 YACC => 'yacc', YFLAGS => '', 35 LEX => 'lex', LFLAGS => '', 36 LDFLAGS => '', 37 CC => 'c99', CFLAGS => '-O', 38 FC => 'fort77', FFLAGS => '-O 1', 39 GET => 'get', GFLAGS => '', 40 SCCSFLAGS => '', SCCSGETFLAGS => '-s'); 41 my $make = join('', map { "\t\@echo '$_=\$($_)'\n" } sort keys %POSIX); 42 my $r = join('', map { "$_=$POSIX{$_}\n"} sort keys %POSIX); 43 run_make_test(qq! 44 .POSIX: 45 all: 46 $make 47 !, 48 '', $r); 49 50 # Make sure that local settings take precedence 51 %extraENV = map { $_ => "xx-$_" } keys %POSIX; 52 $r = join('', map { "$_=xx-$_\n"} sort keys %POSIX); 53 run_make_test(undef, '', $r); 54 32 55 # This tells the test driver that the perl test script executed properly. 33 56 1; -
vendor/gnumake/current/tests/scripts/targets/SECONDARY
r2596 r3138 45 45 46 46 &run_make_with_options($makefile,'foo.d',&get_logfile); 47 $answer = "$make_name: `foo.d' is up to date.\n";47 $answer = "$make_name: 'foo.d' is up to date.\n"; 48 48 &compare_output($answer, &get_logfile(1)); 49 49 … … 68 68 69 69 &run_make_with_options($makefile,'foo.c',&get_logfile); 70 $answer = "$make_name: `foo.c' is up to date.\n";70 $answer = "$make_name: 'foo.c' is up to date.\n"; 71 71 &compare_output($answer, &get_logfile(1)); 72 72 … … 104 104 105 105 &run_make_with_options($makefile2, '', &get_logfile); 106 $answer = "$make_name: `final' is up to date.\n";106 $answer = "$make_name: 'final' is up to date.\n"; 107 107 &compare_output($answer, &get_logfile(1)); 108 108 … … 130 130 %.c : %.b ; cp $< $@ 131 131 %.b : %.a ; cp $< $@ 132 all : 1.c 2.c', '-rR -j', 132 all : 1.c 2.c 133 2.a: 1.c', '-rR -j', 133 134 'cp 1.a 1.b 135 cp 1.b 1.c 134 136 cp 2.a 2.b 135 cp 1.b 1.c136 137 cp 2.b 2.c 137 138 rm 1.b 2.b'); -
vendor/gnumake/current/tests/scripts/variables/DEFAULT_GOAL
r2596 r3138 43 43 ', 44 44 '', 45 '#MAKE#: *** No rule to make target `foo\'. Stop.',45 "#MAKE#: *** No rule to make target 'foo'. Stop.", 46 46 512); 47 47 -
vendor/gnumake/current/tests/scripts/variables/LIBPATTERNS
r2596 r3138 21 21 all: -lfoo ; @echo "build $@ from $<" 22 22 ', 23 '', "#MAKE#: .LIBPATTERNS element `mtest_foo.a' is not a pattern23 '', "#MAKE#: .LIBPATTERNS element 'mtest_foo.a' is not a pattern 24 24 build all from mtest_foo.a\n"); 25 25 -
vendor/gnumake/current/tests/scripts/variables/MAKE
r2596 r3138 17 17 '', 18 18 "#MAKEPATH#\n#MAKEPATH# -f #MAKEFILE# foo\n" 19 . "#MAKE#[1]: Entering directory `#PWD#'\n"20 . "#MAKEPATH#\n#MAKE#[1]: Leaving directory `#PWD#'\n");19 . "#MAKE#[1]: Entering directory '#PWD#'\n" 20 . "#MAKEPATH#\n#MAKE#[1]: Leaving directory '#PWD#'\n"); 21 21 22 22 rmfiles("foo"); -
vendor/gnumake/current/tests/scripts/variables/MAKEFLAGS
r2596 r3138 1 # -*-perl-*-1 # -*-perl-*- 2 2 3 3 $description = "Test proper behavior of MAKEFLAGS"; … … 9 9 all: ; @echo $(MAKEFLAGS) 10 10 !, 11 '-e -r -R', ' Rre');11 '-e -r -R', 'erR'); 12 12 13 13 # Long arguments mean everything is prefixed with "-" … … 15 15 all: ; @echo $(MAKEFLAGS) 16 16 !, 17 '--no-print-directory -e -r -R', '--no-print-directory -Rre'); 17 '--no-print-directory -e -r -R --trace', "#MAKEFILE#:2: target 'all' does not exist 18 echo erR --trace --no-print-directory 19 erR --trace --no-print-directory"); 18 20 19 21 20 if ($all_tests) { 21 # Recursive invocations of make should accumulate MAKEFLAGS values. 22 # Savannah bug #2216 23 run_make_test(q! 22 # Recursive invocations of make should accumulate MAKEFLAGS values. 23 # Savannah bug #2216 24 run_make_test(q! 24 25 MSG = Fails 25 26 all: … … 27 28 @MSG=Works $(MAKE) -e -f #MAKEFILE# jump 28 29 jump: 29 @echo '$@ : MAKEFLAGS=$(MAKEFLAGS)'30 @echo '$@ $(MSG): MAKEFLAGS=$(MAKEFLAGS)' 30 31 @$(MAKE) -f #MAKEFILE# print 31 32 print: 32 @echo '$@: MAKEFLAGS=$(MAKEFLAGS)' 33 @echo $(MSG) 33 @echo '$@ $(MSG): MAKEFLAGS=$(MAKEFLAGS)' 34 34 .PHONY: all jump print 35 35 !, 36 36 '--no-print-directory', 37 37 'all: MAKEFLAGS= --no-print-directory 38 jump: MAKEFLAGS= --no-print-directory -e 39 print: MAKEFLAGS= --no-print-directory -e 40 Works'); 41 } 38 jump Works: MAKEFLAGS=e --no-print-directory 39 print Works: MAKEFLAGS=e --no-print-directory'); 42 40 43 41 1; 42 43 ### Local Variables: 44 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 45 ### End: -
vendor/gnumake/current/tests/scripts/variables/MAKE_RESTARTS
r2596 r3138 12 12 ', 13 13 '', 'MAKE_RESTARTS= 14 #MAKEFILE#:4: foo.x: No such file or directory15 14 MAKE_RESTARTS=1'); 16 15 … … 27 26 ', 28 27 '', 'MAKE_RESTARTS= 29 #MAKEFILE#:4: foo.x: No such file or directory30 28 MAKE_RESTARTS=1 31 foo.x:1: bar.x: No such file or directory32 29 MAKE_RESTARTS=2'); 33 30 … … 48 45 ', 49 46 '', "MAKE_RESTARTS= 50 #MAKEFILE#:8: foo.x: No such file or directory51 47 MAKE_RESTARTS=1 52 foo.x:1: bar.x: No such file or directory53 48 MAKE_RESTARTS=2 54 49 recurse MAKE_RESTARTS= 50 #MAKE#[1]: Entering directory '#PWD#' 55 51 MAKE_RESTARTS= 56 #MAKE#[1]: Entering directory `#PWD#'57 52 all MAKE_RESTARTS= 58 #MAKE#[1]: Leaving directory `#PWD#'");53 #MAKE#[1]: Leaving directory '#PWD#'"); 59 54 60 55 rmfiles('foo.x', 'bar.x'); 61 56 62 57 1; 58 59 ### Local Variables: 60 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 61 ### End: -
vendor/gnumake/current/tests/scripts/variables/SHELL
r2596 r3138 71 71 '', $out); 72 72 73 # Do it again but add spaces to SHELLFLAGS 74 75 # Some shells (*shakes fist at Solaris*) cannot handle multiple flags in 76 # separate arguments. 77 my $t = `/bin/sh -e -c true 2>/dev/null`; 78 my $multi_ok = $? == 0; 79 80 if ($multi_ok) { 81 $flags = '-x -c'; 82 run_make_test(qq! 83 .SHELLFLAGS = $flags 84 all: ; \@$script 85 !, 86 '', $out); 87 } 88 73 89 # We can't just use "false" because on different systems it provides a 74 90 # different exit code--once again Solaris: false exits with 255 not 1 … … 82 98 all: ; \@$script 83 99 !, 84 '', "$out#MAKE#: *** [ all] Error $err\n", 512);100 '', "$out#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512); 85 101 86 102 1; -
vendor/gnumake/current/tests/scripts/variables/define
r2596 r3138 31 31 endef 32 32 33 define posix ::= 34 @echo $(FOO) 35 endef 36 33 37 append = @echo a 34 38 … … 50 54 all: ; $(multi) 51 55 $(simple) 56 $(posix) 52 57 $(append) 53 58 $(cond) 54 59 ', 55 '', "echo hi\nhi\nthere\nfoo\na\nb\nfirst\n"); 60 '', "echo hi\nhi\nthere\nfoo\nfoo\na\nb\nfirst\n"); 61 62 # TEST 1a: Various new-style define/endef, with no spaces 63 64 run_make_test(' 65 FOO = foo 66 67 define multi= 68 echo hi 69 @echo $(FOO) 70 endef # this is the end 71 72 define simple:= 73 @echo $(FOO) 74 endef 75 76 define posix::= 77 @echo $(FOO) 78 endef 79 80 append = @echo a 81 82 define append+= 83 84 @echo b 85 endef 86 87 define cond?= # this is a conditional 88 @echo first 89 endef 90 91 define cond?= 92 @echo second 93 endef 94 95 FOO = there 96 97 all: ; $(multi) 98 $(simple) 99 $(posix) 100 $(append) 101 $(cond) 102 ', 103 '', "echo hi\nhi\nthere\nfoo\nfoo\na\nb\nfirst\n"); 56 104 57 105 # TEST 2: define in true section of conditional (containing conditional) … … 113 161 all: ; @echo ok 114 162 ', 115 '', "#MAKEFILE#:3: extraneous text after `define' directive\nok\n");163 '', "#MAKEFILE#:3: extraneous text after 'define' directive\nok\n"); 116 164 117 165 # TEST 7: NEGATIVE: extra text after endef … … 124 172 all: ; @echo ok 125 173 ', 126 '', "#MAKEFILE#:5: extraneous text after `endef' directive\nok\n");174 '', "#MAKEFILE#:5: extraneous text after 'endef' directive\nok\n"); 127 175 128 176 # TEST 8: NEGATIVE: missing endef … … 135 183 endef$(NAME) 136 184 ', 137 '', "#MAKEFILE#:4: *** missing `endef', unterminated `define'. Stop.\n", 512);185 '', "#MAKEFILE#:4: *** missing 'endef', unterminated 'define'. Stop.\n", 512); 138 186 139 187 # ------------------------- -
vendor/gnumake/current/tests/scripts/variables/flavors
r2596 r3138 74 74 '', "Hello\n"); 75 75 76 # TEST 6: Simple using POSIX syntax 77 run_make_test(' 78 bar = Goodbye 79 foo ::= $(bar) 80 bar = ${ugh} 81 ugh = Hello 82 all: ; @echo $(foo) 83 ', 84 '', "Goodbye\n"); 85 86 # TEST 7: POSIX syntax no spaces 87 run_make_test(' 88 bar = Goodbye 89 foo::=$(bar) 90 bar = ${ugh} 91 ugh = Hello 92 all: ; @echo $(foo) 93 ', 94 '', "Goodbye\n"); 95 76 96 1; -
vendor/gnumake/current/tests/scripts/variables/private
r2596 r3138 76 76 '', "b=a\na=a\n"); 77 77 78 # 9: make sure private suppresses inheritance 79 run_make_test(q! 80 DEFS = FOO 81 all: bar1 82 bar1: private DEFS += 1 83 bar3: private DEFS += 3 84 bar1: bar2 85 bar2: bar3 86 bar1 bar2 bar3: ; @echo '$@: $(DEFS)' 87 !, 88 '', "bar3: FOO 3\nbar2: FOO\nbar1: FOO 1\n"); 89 90 # 10: Test append with pattern-specific variables and private 91 92 run_make_test(q! 93 IA = global 94 PA = global 95 PS = global 96 S = global 97 PS = global 98 SV = global 99 b%: IA += b% 100 b%: private PA += b% 101 b%: private PS = b% 102 bar: all 103 bar: IA += bar 104 bar: private PA += bar 105 bar: private PS = bar 106 a%: IA += a% 107 a%: private PA += a% 108 a%: private PS = a% 109 all: IA += all 110 all: private PA += all 111 all: private PS = all 112 113 bar all: ; @echo '$@: IA=$(IA)'; echo '$@: PA=$(PA)'; echo '$@: PS=$(PS)' 114 !, 115 '', "all: IA=global b% bar a% all 116 all: PA=global a% all 117 all: PS=all 118 bar: IA=global b% bar 119 bar: PA=global b% bar 120 bar: PS=bar\n"); 121 78 122 1; -
vendor/gnumake/current/tests/scripts/variables/special
r2596 r3138 15 15 BAR := bar 16 16 17 all: 18 @echo X1 = $(X1) 19 @echo X2 = $(X2) 20 @echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES))) 17 all: ; @echo X1 = $(X1); echo X2 = $(X2); echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES))) 21 18 ', 22 19 '', "X1 =\nX2 = FOO\nLAST = BAR FOO\n"); 23 20 21 # SV 45728: Test that undefining a variable is reflected properly 24 22 23 &run_make_test(' 24 FOO := foo 25 BAR := bar 26 $(info one: $(sort $(filter FOO BAR BAZ,$(.VARIABLES)))) 27 undefine BAR 28 BAZ := baz 29 $(info two: $(sort $(filter FOO BAR BAZ,$(.VARIABLES)))) 30 all:;@: 31 ', 32 '', "one: BAR FOO\ntwo: BAZ FOO\n"); 25 33 26 34 # $makefile2 = &get_tmpfile; … … 32 40 33 41 # all: foo 34 # @echo X1 = $(X1)35 # @echo X2 = $(X2)36 # @echo LAST = $(sort $(.TARGETS))42 # @echo X1 = $(X1) 43 # @echo X2 = $(X2) 44 # @echo LAST = $(sort $(.TARGETS)) 37 45 38 46 # X2 := $(sort $(.TARGETS)) … … 54 62 &run_make_test(' 55 63 define foo 56 : foo-one \64 : foo-one\ 57 65 foo-two 58 66 : foo-three … … 115 123 : foo-four'); 116 124 125 # Test that the "did you mean TAB" message is printed properly 126 127 run_make_test(q! 128 $x. 129 !, 130 '', '#MAKEFILE#:2: *** missing separator. Stop.', 512); 131 132 run_make_test(q! 133 foo: 134 bar 135 !, 136 '', '#MAKEFILE#:3: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.', 512); 137 138 run_make_test(q! 139 .RECIPEPREFIX = : 140 foo: 141 bar 142 !, 143 '', '#MAKEFILE#:4: *** missing separator. Stop.', 512); 144 117 145 1; 146 147 ### Local Variables: 148 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 149 ### End: -
vendor/gnumake/current/tests/test_driver.pl
r2596 r3138 6 6 # Modified 92-02-11 through 92-02-22 by Chris Arthur to further generalize. 7 7 # 8 # Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 9 # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software 10 # Foundation, Inc. 8 # Copyright (C) 1991-2016 Free Software Foundation, Inc. 11 9 # This file is part of GNU Make. 12 10 # … … 31 29 # variables and then calls &toplevel, which does all the real work. 32 30 33 # $Id : test_driver.pl,v 1.30 2010/07/28 05:39:50 psmith Exp$31 # $Id$ 34 32 35 33 … … 51 49 $test_passed = 1; 52 50 53 54 51 # Timeout in seconds. If the test takes longer than this we'll fail it. 55 52 $test_timeout = 5; 53 $test_timeout = 10 if $^O eq 'VMS'; 56 54 57 55 # Path to Perl … … 65 63 %extraENV = (); 66 64 65 sub vms_get_process_logicals { 66 # Sorry for the long note here, but to keep this test running on 67 # VMS, it is needed to be understood. 68 # 69 # Perl on VMS by default maps the %ENV array to the system wide logical 70 # name table. 71 # 72 # This is a very large dynamically changing table. 73 # On Linux, this would be the equivalent of a table that contained 74 # every mount point, temporary pipe, and symbolic link on every 75 # file system. You normally do not have permission to clear or replace it, 76 # and if you did, the results would be catastrophic. 77 # 78 # On VMS, added/changed %ENV items show up in the process logical 79 # name table. So to track changes, a copy of it needs to be captured. 80 81 my $raw_output = `show log/process/access_mode=supervisor`; 82 my @raw_output_lines = split('\n',$raw_output); 83 my %log_hash; 84 foreach my $line (@raw_output_lines) { 85 if ($line =~ /^\s+"([A-Za-z\$_]+)"\s+=\s+"(.+)"$/) { 86 $log_hash{$1} = $2; 87 } 88 } 89 return \%log_hash 90 } 91 67 92 # %origENV is the caller's original environment 68 %origENV = %ENV; 93 if ($^O ne 'VMS') { 94 %origENV = %ENV; 95 } else { 96 my $proc_env = vms_get_process_logicals; 97 %origENV = %{$proc_env}; 98 } 69 99 70 100 sub resetENV … … 73 103 # through Perl 5.004. It was fixed in Perl 5.004_01, but we don't 74 104 # want to require that here, so just delete each one individually. 75 foreach $v (keys %ENV) { 76 delete $ENV{$v}; 77 } 78 79 %ENV = %makeENV; 105 106 if ($^O ne 'VMS') { 107 foreach $v (keys %ENV) { 108 delete $ENV{$v}; 109 } 110 111 %ENV = %makeENV; 112 } else { 113 my $proc_env = vms_get_process_logicals(); 114 my %delta = %{$proc_env}; 115 foreach my $v (keys %delta) { 116 if (exists $origENV{$v}) { 117 if ($origENV{$v} ne $delta{$v}) { 118 $ENV{$v} = $origENV{$v}; 119 } 120 } else { 121 delete $ENV{$v}; 122 } 123 } 124 } 125 80 126 foreach $v (keys %extraENV) { 81 127 $ENV{$v} = $extraENV{$v}; … … 90 136 foreach (# UNIX-specific things 91 137 'TZ', 'TMPDIR', 'HOME', 'USER', 'LOGNAME', 'PATH', 138 'LD_LIBRARY_PATH', 92 139 # Purify things 93 140 'PURIFYOPTIONS', … … 107 154 # Replace the environment with the new one 108 155 # 109 %origENV = %ENV ;156 %origENV = %ENV unless $^O eq 'VMS'; 110 157 111 158 resetENV(); … … 132 179 &parse_command_line (@ARGV); 133 180 134 print "OS name = `$osname'\n" if $debug;181 print "OS name = '$osname'\n" if $debug; 135 182 136 183 $workpath = "$cwdslash$workdir"; … … 140 187 141 188 &print_banner; 189 190 if ($osname eq 'VMS' && $cwdslash eq "") 191 { 192 # Porting this script to VMS revealed a small bug in opendir() not 193 # handling search lists correctly when the directory only exists in 194 # one of the logical_devices. Need to find the first directory in 195 # the search list, as that is where things will be written to. 196 my @dirs = split("/", $pwd); 197 198 my $logical_device = $ENV{$dirs[1]}; 199 if ($logical_device =~ /([A-Za-z0-9_]+):(:?.+:)+/) 200 { 201 # A search list was found. Grab the first logical device 202 # and use it instead of the search list. 203 $dirs[1]=$1; 204 my $lcl_pwd = join('/', @dirs); 205 $workpath = $lcl_pwd . '/' . $workdir 206 } 207 } 142 208 143 209 if (-d $workpath) … … 167 233 push (@rmdirs, $dir); 168 234 -d "$workpath/$dir" 169 || mkdir ("$workpath/$dir", 0777)235 || mkdir ("$workpath/$dir", 0777) 170 236 || &error ("Couldn't mkdir $workpath/$dir: $!\n"); 171 237 } … … 176 242 print "Finding tests...\n"; 177 243 opendir (SCRIPTDIR, $scriptpath) 178 || &error ("Couldn't opendir $scriptpath: $!\n");244 || &error ("Couldn't opendir $scriptpath: $!\n"); 179 245 @dirs = grep (!/^(\..*|CVS|RCS)$/, readdir (SCRIPTDIR) ); 180 246 closedir (SCRIPTDIR); … … 183 249 next if ($dir =~ /^(\..*|CVS|RCS)$/ || ! -d "$scriptpath/$dir"); 184 250 push (@rmdirs, $dir); 251 # VMS can have overlayed file systems, so directories may repeat. 252 next if -d "$workpath/$dir"; 185 253 mkdir ("$workpath/$dir", 0777) 186 || &error ("Couldn't mkdir $workpath/$dir: $!\n");254 || &error ("Couldn't mkdir $workpath/$dir: $!\n"); 187 255 opendir (SCRIPTDIR, "$scriptpath/$dir") 188 || &error ("Couldn't opendir $scriptpath/$dir: $!\n");256 || &error ("Couldn't opendir $scriptpath/$dir: $!\n"); 189 257 @files = grep (!/^(\..*|CVS|RCS|.*~)$/, readdir (SCRIPTDIR) ); 190 258 closedir (SCRIPTDIR); … … 192 260 { 193 261 -d $test and next; 194 push (@TESTS, "$dir/$test");262 push (@TESTS, "$dir/$test"); 195 263 } 196 264 } … … 204 272 print "\n"; 205 273 206 &run_each_test;274 run_all_tests(); 207 275 208 276 foreach $dir (@rmdirs) … … 222 290 print " in $categories_failed Categor"; 223 291 print ($categories_failed == 1 ? "y" : "ies"); 224 print " Failed (See .$diffext files in $workdir dir for details) :-(\n\n";292 print " Failed (See .$diffext* files in $workdir dir for details) :-(\n\n"; 225 293 return 0; 226 294 } … … 241 309 $osname = defined($^O) ? $^O : ''; 242 310 311 if ($osname eq 'VMS') 312 { 313 $vos = 0; 314 $pathsep = "/"; 315 return; 316 } 317 243 318 # Find a path to Perl 244 319 … … 277 352 if ($osname =~ /not found/i) 278 353 { 279 $osname = "(something posixy with no uname)";354 $osname = "(something posixy with no uname)"; 280 355 } 281 356 elsif ($@ ne "" || $?) … … 284 359 if ($@ ne "" || $?) 285 360 { 286 $osname = "(something posixy)";287 }361 $osname = "(something posixy)"; 362 } 288 363 } 289 364 $vos = 0; … … 417 492 } 418 493 419 sub run_each_test 420 { 421 $categories_run = 0; 422 423 foreach $testname (sort @TESTS) 424 { 425 ++$categories_run; 426 $suite_passed = 1; # reset by test on failure 427 $num_of_logfiles = 0; 428 $num_of_tmpfiles = 0; 429 $description = ""; 430 $details = ""; 431 $old_makefile = undef; 432 $testname =~ s/^$scriptpath$pathsep//; 433 $perl_testname = "$scriptpath$pathsep$testname"; 434 $testname =~ s/(\.pl|\.perl)$//; 435 $testpath = "$workpath$pathsep$testname"; 436 # Leave enough space in the extensions to append a number, even 437 # though it needs to fit into 8+3 limits. 438 if ($short_filenames) { 439 $logext = 'l'; 440 $diffext = 'd'; 441 $baseext = 'b'; 442 $runext = 'r'; 443 $extext = ''; 444 } else { 445 $logext = 'log'; 446 $diffext = 'diff'; 447 $baseext = 'base'; 448 $runext = 'run'; 449 $extext = '.'; 450 } 451 $log_filename = "$testpath.$logext"; 452 $diff_filename = "$testpath.$diffext"; 453 $base_filename = "$testpath.$baseext"; 454 $run_filename = "$testpath.$runext"; 455 $tmp_filename = "$testpath.$tmpfilesuffix"; 456 457 &setup_for_test; # suite-defined 458 459 $output = "........................................................ "; 460 461 substr($output,0,length($testname)) = "$testname "; 462 463 print $output; 464 465 # Run the actual test! 466 $tests_run = 0; 467 $tests_passed = 0; 468 469 $code = do $perl_testname; 470 471 $total_tests_run += $tests_run; 472 $total_tests_passed += $tests_passed; 473 474 # How did it go? 475 if (!defined($code)) 476 { 477 $suite_passed = 0; 478 if (length ($@)) { 479 warn "\n*** Test died ($testname): $@\n"; 480 } else { 481 warn "\n*** Couldn't run $perl_testname\n"; 482 } 483 } 484 elsif ($code == -1) { 485 $suite_passed = 0; 486 } 487 elsif ($code != 1 && $code != -1) { 488 $suite_passed = 0; 489 warn "\n*** Test returned $code\n"; 490 } 491 492 if ($suite_passed) { 493 ++$categories_passed; 494 $status = "ok ($tests_passed passed)"; 495 for ($i = $num_of_tmpfiles; $i; $i--) 496 { 497 &rmfiles ($tmp_filename . &num_suffix ($i) ); 498 } 499 500 for ($i = $num_of_logfiles ? $num_of_logfiles : 1; $i; $i--) 501 { 502 &rmfiles ($log_filename . &num_suffix ($i) ); 503 &rmfiles ($base_filename . &num_suffix ($i) ); 504 } 505 } 506 elsif (!defined $code || $code > 0) { 507 $status = "FAILED ($tests_passed/$tests_run passed)"; 508 } 509 elsif ($code < 0) { 510 $status = "N/A"; 511 --$categories_run; 512 } 513 514 # If the verbose option has been specified, then a short description 515 # of each test is printed before displaying the results of each test 516 # describing WHAT is being tested. 517 518 if ($verbose) 519 { 520 if ($detail) 521 { 522 print "\nWHAT IS BEING TESTED\n"; 523 print "--------------------"; 524 } 525 print "\n\n$description\n\n"; 526 } 527 528 # If the detail option has been specified, then the details of HOW 529 # the test is testing what it says it is testing in the verbose output 530 # will be displayed here before the results of the test are displayed. 531 532 if ($detail) 533 { 534 print "\nHOW IT IS TESTED\n"; 535 print "----------------"; 536 print "\n\n$details\n\n"; 537 } 538 539 print "$status\n"; 540 } 494 sub run_all_tests 495 { 496 $categories_run = 0; 497 498 $lasttest = ''; 499 foreach $testname (sort @TESTS) { 500 # Skip duplicates on VMS caused by logical name search lists. 501 next if $testname eq $lasttest; 502 $lasttest = $testname; 503 $suite_passed = 1; # reset by test on failure 504 $num_of_logfiles = 0; 505 $num_of_tmpfiles = 0; 506 $description = ""; 507 $details = ""; 508 $old_makefile = undef; 509 $testname =~ s/^$scriptpath$pathsep//; 510 $perl_testname = "$scriptpath$pathsep$testname"; 511 $testname =~ s/(\.pl|\.perl)$//; 512 $testpath = "$workpath$pathsep$testname"; 513 # Leave enough space in the extensions to append a number, even 514 # though it needs to fit into 8+3 limits. 515 if ($short_filenames) { 516 $logext = 'l'; 517 $diffext = 'd'; 518 $baseext = 'b'; 519 $runext = 'r'; 520 $extext = ''; 521 } else { 522 $logext = 'log'; 523 $diffext = 'diff'; 524 $baseext = 'base'; 525 $runext = 'run'; 526 $extext = '.'; 527 } 528 $extext = '_' if $^O eq 'VMS'; 529 $log_filename = "$testpath.$logext"; 530 $diff_filename = "$testpath.$diffext"; 531 $base_filename = "$testpath.$baseext"; 532 $run_filename = "$testpath.$runext"; 533 $tmp_filename = "$testpath.$tmpfilesuffix"; 534 535 setup_for_test(); 536 537 $output = "........................................................ "; 538 539 substr($output,0,length($testname)) = "$testname "; 540 541 print $output; 542 543 $tests_run = 0; 544 $tests_passed = 0; 545 546 # Run the test! 547 $code = do $perl_testname; 548 549 ++$categories_run; 550 $total_tests_run += $tests_run; 551 $total_tests_passed += $tests_passed; 552 553 # How did it go? 554 if (!defined($code)) { 555 # Failed to parse or called die 556 if (length ($@)) { 557 warn "\n*** Test died ($testname): $@\n"; 558 } else { 559 warn "\n*** Couldn't parse $perl_testname\n"; 560 } 561 $status = "FAILED ($tests_passed/$tests_run passed)"; 562 } 563 564 elsif ($code == -1) { 565 # Skipped... not supported 566 $status = "N/A"; 567 --$categories_run; 568 } 569 570 elsif ($code != 1) { 571 # Bad result... this shouldn't really happen. Usually means that 572 # the suite forgot to end with "1;". 573 warn "\n*** Test returned $code\n"; 574 $status = "FAILED ($tests_passed/$tests_run passed)"; 575 } 576 577 elsif ($tests_run == 0) { 578 # Nothing was done!! 579 $status = "FAILED (no tests found!)"; 580 } 581 582 elsif ($tests_run > $tests_passed) { 583 # Lose! 584 $status = "FAILED ($tests_passed/$tests_run passed)"; 585 } 586 587 else { 588 # Win! 589 ++$categories_passed; 590 $status = "ok ($tests_passed passed)"; 591 592 # Clean up 593 for ($i = $num_of_tmpfiles; $i; $i--) { 594 rmfiles($tmp_filename . num_suffix($i)); 595 } 596 for ($i = $num_of_logfiles ? $num_of_logfiles : 1; $i; $i--) { 597 rmfiles($log_filename . num_suffix($i)); 598 rmfiles($base_filename . num_suffix($i)); 599 } 600 } 601 602 # If the verbose option has been specified, then a short description 603 # of each test is printed before displaying the results of each test 604 # describing WHAT is being tested. 605 606 if ($verbose) { 607 if ($detail) { 608 print "\nWHAT IS BEING TESTED\n"; 609 print "--------------------"; 610 } 611 print "\n\n$description\n\n"; 612 } 613 614 # If the detail option has been specified, then the details of HOW 615 # the test is testing what it says it is testing in the verbose output 616 # will be displayed here before the results of the test are displayed. 617 618 if ($detail) { 619 print "\nHOW IT IS TESTED\n"; 620 print "----------------"; 621 print "\n\n$details\n\n"; 622 } 623 624 print "$status\n"; 625 } 541 626 } 542 627 … … 655 740 local($slurp, $answer_matched) = ('', 0); 656 741 657 print "Comparing Output ........ " if $debug;658 659 $slurp = &read_file_into_string ($logfile);660 661 # For make, get rid of any time skew error before comparing--too bad this662 # has to go into the "generic" driver code :-/663 $slurp =~ s/^.*modification time .*in the future.*\n//gm;664 $slurp =~ s/^.*Clock skew detected.*\n//gm;665 666 742 ++$tests_run; 667 743 668 if ($slurp eq $answer) { 669 $answer_matched = 1; 744 if (! defined $answer) { 745 print "Ignoring output ........ " if $debug; 746 $answer_matched = 1; 670 747 } else { 671 # See if it is a slash or CRLF problem 672 local ($answer_mod, $slurp_mod) = ($answer, $slurp); 673 674 $answer_mod =~ tr,\\,/,; 675 $answer_mod =~ s,\r\n,\n,gs; 676 677 $slurp_mod =~ tr,\\,/,; 678 $slurp_mod =~ s,\r\n,\n,gs; 679 680 $answer_matched = ($slurp_mod eq $answer_mod); 681 682 # If it still doesn't match, see if the answer might be a regex. 683 if (!$answer_matched && $answer =~ m,^/(.+)/$,) { 684 $answer_matched = ($slurp =~ /$1/); 685 if (!$answer_matched && $answer_mod =~ m,^/(.+)/$,) { 686 $answer_matched = ($slurp_mod =~ /$1/); 748 print "Comparing Output ........ " if $debug; 749 750 $slurp = &read_file_into_string ($logfile); 751 752 # For make, get rid of any time skew error before comparing--too bad this 753 # has to go into the "generic" driver code :-/ 754 $slurp =~ s/^.*modification time .*in the future.*\n//gm; 755 $slurp =~ s/^.*Clock skew detected.*\n//gm; 756 757 if ($slurp eq $answer) { 758 $answer_matched = 1; 759 } else { 760 # See if it is a slash or CRLF problem 761 local ($answer_mod, $slurp_mod) = ($answer, $slurp); 762 763 $answer_mod =~ tr,\\,/,; 764 $answer_mod =~ s,\r\n,\n,gs; 765 766 $slurp_mod =~ tr,\\,/,; 767 $slurp_mod =~ s,\r\n,\n,gs; 768 769 $answer_matched = ($slurp_mod eq $answer_mod); 770 if ($^O eq 'VMS') { 771 772 # VMS has extra blank lines in output sometimes. 773 # Ticket #41760 774 if (!$answer_matched) { 775 $slurp_mod =~ s/\n\n+/\n/gm; 776 $slurp_mod =~ s/\A\n+//g; 777 $answer_matched = ($slurp_mod eq $answer_mod); 778 } 779 780 # VMS adding a "Waiting for unfinished jobs..." 781 # Remove it for now to see what else is going on. 782 if (!$answer_matched) { 783 $slurp_mod =~ s/^.+\*\*\* Waiting for unfinished jobs.+$//m; 784 $slurp_mod =~ s/\n\n/\n/gm; 785 $slurp_mod =~ s/^\n+//gm; 786 $answer_matched = ($slurp_mod eq $answer_mod); 787 } 788 789 # VMS wants target device to exist or generates an error, 790 # Some test tagets look like VMS devices and trip this. 791 if (!$answer_matched) { 792 $slurp_mod =~ s/^.+\: no such device or address.*$//gim; 793 $slurp_mod =~ s/\n\n/\n/gm; 794 $slurp_mod =~ s/^\n+//gm; 795 $answer_matched = ($slurp_mod eq $answer_mod); 796 } 797 798 # VMS error message has a different case 799 if (!$answer_matched) { 800 $slurp_mod =~ s/no such file /No such file /gm; 801 $answer_matched = ($slurp_mod eq $answer_mod); 802 } 803 804 # VMS is putting comas instead of spaces in output 805 if (!$answer_matched) { 806 $slurp_mod =~ s/,/ /gm; 807 $answer_matched = ($slurp_mod eq $answer_mod); 808 } 809 810 # VMS Is sometimes adding extra leading spaces to output? 811 if (!$answer_matched) { 812 my $slurp_mod = $slurp_mod; 813 $slurp_mod =~ s/^ +//gm; 814 $answer_matched = ($slurp_mod eq $answer_mod); 815 } 816 817 # VMS port not handling POSIX encoded child status 818 # Translate error case it for now. 819 if (!$answer_matched) { 820 $slurp_mod =~ s/0x1035a00a/1/gim; 821 $answer_matched = 1 if $slurp_mod =~ /\Q$answer_mod\E/i; 822 823 } 824 if (!$answer_matched) { 825 $slurp_mod =~ s/0x1035a012/2/gim; 826 $answer_matched = ($slurp_mod eq $answer_mod); 827 } 828 829 # Tests are using a UNIX null command, temp hack 830 # until this can be handled by the VMS port. 831 # ticket # 41761 832 if (!$answer_matched) { 833 $slurp_mod =~ s/^.+DCL-W-NOCOMD.*$//gim; 834 $slurp_mod =~ s/\n\n+/\n/gm; 835 $slurp_mod =~ s/^\n+//gm; 836 $answer_matched = ($slurp_mod eq $answer_mod); 837 } 838 # Tests are using exit 0; 839 # this generates a warning that should stop the make, but does not 840 if (!$answer_matched) { 841 $slurp_mod =~ s/^.+NONAME-W-NOMSG.*$//gim; 842 $slurp_mod =~ s/\n\n+/\n/gm; 843 $slurp_mod =~ s/^\n+//gm; 844 $answer_matched = ($slurp_mod eq $answer_mod); 845 } 846 847 # VMS is sometimes adding single quotes to output? 848 if (!$answer_matched) { 849 my $noq_slurp_mod = $slurp_mod; 850 $noq_slurp_mod =~ s/\'//gm; 851 $answer_matched = ($noq_slurp_mod eq $answer_mod); 852 853 # And missing an extra space in output 854 if (!$answer_matched) { 855 $noq_answer_mod = $answer_mod; 856 $noq_answer_mod =~ s/\h\h+/ /gm; 857 $answer_matched = ($noq_slurp_mod eq $noq_answer_mod); 858 } 859 860 # VMS adding ; to end of some lines. 861 if (!$answer_matched) { 862 $noq_slurp_mod =~ s/;\n/\n/gm; 863 $answer_matched = ($noq_slurp_mod eq $noq_answer_mod); 864 } 865 866 # VMS adding trailing space to end of some quoted lines. 867 if (!$answer_matched) { 868 $noq_slurp_mod =~ s/\h+\n/\n/gm; 869 $answer_matched = ($noq_slurp_mod eq $noq_answer_mod); 870 } 871 872 # And VMS missing leading blank line 873 if (!$answer_matched) { 874 $noq_answer_mod =~ s/\A\n//g; 875 $answer_matched = ($noq_slurp_mod eq $noq_answer_mod); 876 } 877 878 # Unix double quotes showing up as single quotes on VMS. 879 if (!$answer_matched) { 880 $noq_answer_mod =~ s/\"//g; 881 $answer_matched = ($noq_slurp_mod eq $noq_answer_mod); 882 } 883 } 884 } 885 886 # If it still doesn't match, see if the answer might be a regex. 887 if (!$answer_matched && $answer =~ m,^/(.+)/$,) { 888 $answer_matched = ($slurp =~ /$1/); 889 if (!$answer_matched && $answer_mod =~ m,^/(.+)/$,) { 890 $answer_matched = ($slurp_mod =~ /$1/); 891 } 892 } 687 893 } 688 }689 894 } 690 895 … … 708 913 local($command) = "diff -c " . &get_basefile . " " . $logfile; 709 914 &run_command_with_output(&get_difffile,$command); 710 } else { 711 &rmfiles (); 712 } 713 714 $suite_passed = 0; 915 } 916 715 917 return 0; 716 918 } … … 732 934 } 733 935 936 my @OUTSTACK = (); 937 my @ERRSTACK = (); 938 734 939 sub attach_default_output 735 940 { … … 744 949 } 745 950 746 open ("SAVEDOS" . $default_output_stack_level . "out", ">&STDOUT") 747 || &error ("ado: $! duping STDOUT\n", 1); 748 open ("SAVEDOS" . $default_output_stack_level . "err", ">&STDERR") 749 || &error ("ado: $! duping STDERR\n", 1); 750 751 open (STDOUT, "> " . $filename) 752 || &error ("ado: $filename: $!\n", 1); 753 open (STDERR, ">&STDOUT") 754 || &error ("ado: $filename: $!\n", 1); 755 756 $default_output_stack_level++; 951 my $dup = undef; 952 open($dup, '>&', STDOUT) or error("ado: $! duping STDOUT\n", 1); 953 push @OUTSTACK, $dup; 954 955 $dup = undef; 956 open($dup, '>&', STDERR) or error("ado: $! duping STDERR\n", 1); 957 push @ERRSTACK, $dup; 958 959 open(STDOUT, '>', $filename) or error("ado: $filename: $!\n", 1); 960 open(STDERR, ">&STDOUT") or error("ado: $filename: $!\n", 1); 757 961 } 758 962 … … 771 975 } 772 976 773 if (--$default_output_stack_level < 0) 774 { 775 &error ("default output stack has flown under!\n", 1); 776 } 777 778 close (STDOUT); 779 close (STDERR); 780 781 open (STDOUT, ">&SAVEDOS" . $default_output_stack_level . "out") 782 || &error ("ddo: $! duping STDOUT\n", 1); 783 open (STDERR, ">&SAVEDOS" . $default_output_stack_level . "err") 784 || &error ("ddo: $! duping STDERR\n", 1); 785 786 close ("SAVEDOS" . $default_output_stack_level . "out") 787 || &error ("ddo: $! closing SCSDOSout\n", 1); 788 close ("SAVEDOS" . $default_output_stack_level . "err") 789 || &error ("ddo: $! closing SAVEDOSerr\n", 1); 977 @OUTSTACK or error("default output stack has flown under!\n", 1); 978 979 close(STDOUT); 980 close(STDERR) unless $^O eq 'VMS'; 981 982 983 open (STDOUT, '>&', pop @OUTSTACK) or error("ddo: $! duping STDOUT\n", 1); 984 open (STDERR, '>&', pop @ERRSTACK) or error("ddo: $! duping STDERR\n", 1); 790 985 } 791 986 … … 801 996 802 997 eval { 803 local $SIG{ALRM} = sub { die "timeout\n"; }; 804 alarm $test_timeout; 805 $code = system(@_); 998 if ($^O eq 'VMS') { 999 local $SIG{ALRM} = sub { 1000 my $e = $ERRSTACK[0]; 1001 print $e "\nTest timed out after $test_timeout seconds\n"; 1002 die "timeout\n"; }; 1003 # alarm $test_timeout; 1004 system(@_); 1005 my $severity = ${^CHILD_ERROR_NATIVE} & 7; 1006 $code = 0; 1007 if (($severity & 1) == 0) { 1008 $code = 512; 1009 } 1010 1011 # Get the vms status. 1012 my $vms_code = ${^CHILD_ERROR_NATIVE}; 1013 1014 # Remove the print status bit 1015 $vms_code &= ~0x10000000; 1016 1017 # Posix code translation. 1018 if (($vms_code & 0xFFFFF000) == 0x35a000) { 1019 $code = (($vms_code & 0xFFF) >> 3) * 256; 1020 } 1021 } else { 1022 my $pid = fork(); 1023 if (! $pid) { 1024 exec(@_) or die "Cannot execute $_[0]\n"; 1025 } 1026 local $SIG{ALRM} = sub { my $e = $ERRSTACK[0]; print $e "\nTest timed out after $test_timeout seconds\n"; die "timeout\n"; }; 1027 alarm $test_timeout; 1028 waitpid($pid, 0) > 0 or die "No such pid: $pid\n"; 1029 $code = $?; 1030 } 806 1031 alarm 0; 807 1032 }; 808 1033 if ($@) { 809 1034 # The eval failed. If it wasn't SIGALRM then die. 810 $@ eq "timeout\n" or die ;1035 $@ eq "timeout\n" or die "Command failed: $@"; 811 1036 812 1037 # Timed out. Resend the alarm to our process group to kill the children. … … 827 1052 my $code = _run_command(@_); 828 1053 print "run_command returned $code.\n" if $debug; 829 1054 print "vms status = ${^CHILD_ERROR_NATIVE}\n" if $debug and $^O eq 'VMS'; 830 1055 return $code; 831 1056 } … … 842 1067 print "\nrun_command_with_output($filename,$runname): @_\n" if $debug; 843 1068 &attach_default_output ($filename); 844 my $code = _run_command(@_); 1069 my $code = eval { _run_command(@_) }; 1070 my $err = $@; 845 1071 &detach_default_output; 1072 1073 $err and die $err; 1074 846 1075 print "run_command_with_output returned $code.\n" if $debug; 847 1076 print "vms status = ${^CHILD_ERROR_NATIVE}\n" if $debug and $^O eq 'VMS'; 848 1077 return $code; 849 1078 } … … 905 1134 else 906 1135 { 907 unlink $object || return 0; 1136 if ($^O ne 'VMS') 1137 { 1138 unlink $object || return 0; 1139 } 1140 else 1141 { 1142 # VMS can have multiple versions of a file. 1143 1 while unlink $object; 1144 } 908 1145 } 909 1146 } … … 943 1180 foreach $file (@_) { 944 1181 (open(T, ">> $file") && print(T "\n") && close(T)) 945 || &error("Couldn't touch $file: $!\n", 1);1182 || &error("Couldn't touch $file: $!\n", 1); 946 1183 } 947 1184 }
Note:
See TracChangeset
for help on using the changeset viewer.

