summaryrefslogtreecommitdiff
path: root/tests/scripts/features/patternrules
Commit message (Collapse)AuthorAgeFilesLines
* Adjust output strings to be alignedPaul Smith2023-04-021-3/+3
| | | | | | | | Change error and fatal messages to start with lowercase and not end with a period. Note a few very common messages were left as-is, just in case some other tools parse them. Also modify the test known-good-output to satisfy the messages.
* Apply spelling fixes discovered by CodespellPaul Smith2022-12-311-1/+1
| | | | | | | | | | | | | | | | | | * maintMakefile: Apply spelling fixes. * src/file.c: Ditto. * src/misc.c: Ditto. * src/remake.c: Ditto. * src/vmsjobs.c: Ditto. * src/w32/pathstuff.c: Ditto. * tests/test_driver.pl: Ditto. * tests/run_make_tests.com: Ditto * tests/scripts/features/implicit_search: Ditto * tests/scripts/features/output-sync: Ditto * tests/scripts/features/patternrules: Ditto * tests/scripts/features/se_explicit: Ditto * tests/scripts/features/statipattrules: Ditto * tests/scripts/functions/foreach: Ditto * tests/scripts/variables/MAKEFLAGS: Ditto
* Increase the test framework timeout from 5s to 60sPaul Smith2022-10-251-1/+1
| | | | | | | | | | | | It seems that some of the test environments hit the 5s timeout on some tests. Since it doesn't really matter, as long as we don't hang forever, increase the timeout to 60s. * tests/test_driver.pl: Increase $test_timout to 60. We don't need to handle VMS timeouts specially anymore. * tests/scripts/features/parallelism: We don't need to override the default timeout anymore. * tests/scripts/features/patternrules: Remove confusing comment.
* [SV 63098] Enhance detection of missing peer also-make targetsPaul Smith2022-10-221-0/+22
| | | | | | | | | | | | The previous attempt to detect missing peer targets for implicit rules had some holes. Move the detection to notice_finished_file(). * src/remake.c (check_also_make): If we don't have the current mtime for the file, obtain it. (update_goal_chain): Don't call check_also_make() here. (check_dep): Ditto. (notice_finished_file): If we finished running an implicit rule that has also_make targets, invoke check_also_make().
* [SV 63098] Temporarily revert the change to pattern rule behaviorPaul Smith2022-10-021-4/+23
| | | | | | | | | | | | | | | | | | | | The fix for SV 12078 caused a backward-compatibility issue with some makefiles. In order to allow users to resolve this issue, revert that change for this release cycle: it will be reinstated in the next release cycle. Introduce a warning if we detect that the recipe of a multi-target pattern rule doesn't create all the targets. * NEWS: Announce the future backward-incompatibility. * doc/make.texi (Pattern Intro): Describe the behavior and that it will change in the future. * src/remake.c (check_also_make): Check for also_make targets that were not created and generate a warning. (update_goal_chain): Call the new function. (check_dep): Ditto. (update_file_1): Defer implicit rule detection until after we check all the also_make files (as it used to be). * tests/scripts/features/patternrules: Add tests of the new warning. Skip the tests for SV 12078.
* [SV 12078, SV 62809] Rebuild grouped targets if any is missingPaul Smith2022-09-201-1/+56
| | | | | | | | | | | | | | | | | | | If any of a set of grouped targets is missing or out of date, even if make is not trying to build that target, rebuild them all. Ensure this is true for explicit grouped targets as well as pattern rule grouped targets. Original patch by Jonathan Gravel <jo@stashed.dev> * src/remake.c (update_file_1): After matching any pattern rules, go through the also_make targets and set noexist as needed. Also compute the oldest this_mtime. * tests/scripts/features/grouped_targets: Add regression tests. * tests/scripts/features/patternrules: Ditto. * tests/features/vpath: Rewrite to use modern run_make_test(). Add a test that we check for VPATH before implicit rule search. Move the tests in vpath2 and vpath3 into this suite. * tests/features/vpathplus: Rewrite to use modern run_make_test().
* [SV 62206] Fix %-substitution in second expansion of pattern rulesDmitry Goncharov2022-04-241-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | During second expansion of pattern rules only the first pattern in each "group" was being substituted. E.g. in this makefile: .SECONDEXPANSION: all: hello.x %.x: $$(wordlist 1, 99, %.1 %.%.2) ; $(info $@ from $^) hello.1 hello.\%.2 \%.1 \%.\%.2: ; the output would build "hello.1" and "%.%.2" because each function is considered a single "word" and only the first pattern is replaced. Fix the expansion so each whitespace-separated string is considered a word and the first pattern is replaced, giving "hello.1" and "hello.%.2". * src/rule.c (snap_implicit_rules): Keep enough space to replace % with $(*F) if necessary. * src/implicit.c (pattern_search): During second expansion break each get_next_word result into individual words and replace the first % in each with $* or $(*F) as needed. * tests/scripts/features/patternrules: Add tests for variations.
* [SV 62175] Rework secondary expansion testsDmitry Goncharov2022-04-241-15/+16
| | | | | | | | | | The hash function we use can yield different results on big- and little-endian systems which makes test output different. Choose names to avoid this. * tests/scripts/features/patternrules: Choose portable target names. * tests/scripts/features/se_explicit: Ditto. * tests/scripts/features/se_implicit: Ditto.
* [SV 48643] Add more tests of intermediates and unrelated targetsDmitry Goncharov2022-02-061-0/+12
| | | | | | | | | | | | | If a prereq of a pattern is explicitly mentioned as a prereq of an unrelated rule, it should not be considered an intermediate file. * tests/scripts/features/double_colon: Add tests mentioning unrelated explicit targets. * tests/scripts/features/grouped_targets: Ditto. * tests/scripts/features/implicit_search: Ditto. * tests/scripts/features/patternrules: Ditto. * tests/scripts/features/se_implicit: Ditto. * tests/scripts/features/statipattrules: Ditto.
* Do not force targets to be SECONDARYPaul Smith2021-12-291-0/+12
| | | | | | | | | | | | | In SV 43677 we forced targets to be secondary if we found an intermediate file that was listed as a prerequisite of another target. This overrides .INTERMEDIATE settings, so doesn't work. Now that we have an is_explicit flag in targets, use that instead. * src/implicit.c (pattern_search): Remove setting of secondary. Preserve the value of the is_explicit flag when creating a new file target, and consider it when setting the intermediate flag. * tests/scripts/features/patternrules: Add a test w/out INTERMEDIATE * tests/scripts/targets/INTERMEDIATE: Add a test with INTERMEDIATE
* [SV 60435] Ensure intermediate grouped files are removedDmitry Goncharov2021-09-071-79/+188
| | | | | | | | | | | | | | | | | | | | | | | | If multiple intermediate files are built together be sure all of them are removed after make is finished. Continue to ensure that targets that exist before make starts are not removed even if they appear to be intermediate. Add a number of tests to pattern rules to verify this behavior. * src/filedef.h (struct file): Add a new is_explicit bitfield. * src/file.c (rehash_file): Merge the is_explicit bit. (enter_prereqs): Set is_explicit if the file is explicitly mentioned. * src/implicit.c (pattern_search): Set intermediate on the file if it's not explicit. (record_files): Set is_explicit if a file is mentioned as a target. * src/remake.c (update_file_1): Set secondary on files that already exist so they won't be removed. * tests/scripts/features/double_colon: Add a test for double-colon pattern rules. * tests/scripts/features/patternrules: Update KGO for tests where more files are removed. Add new tests to verify handling removal of intermediate files in the context of grouped pattern targets.
* [SV 60188] Explicit prereqs cannot be intermediate filesDmitry Goncharov2021-03-151-1/+88
| | | | | | | | | | | | | | | | | | If a prereq of a pattern is an explicit target, it should not be considered an intermediate file. (Minor tweaks by Paul Smith <psmith@gnu.org>) * src/dep.h (struct nameseq): Add is_explicit flag. * src/implicit.c (struct patdeps): Ditto. (pattern_search): Set the is_explicit flag appropriately for each prerequisite, based on whether it contained a pattern or not. Update the help output to note implicit vs. explicit prereqs. * tests/scripts/features/double_colon: Add tests. * tests/scripts/features/grouped_targets: Ditto. * tests/scripts/features/patternrules: Ditto. * tests/scripts/features/se_implicit: Ditto. * tests/scripts/features/statipattrules: Ditto.
* * tests/scripts/features/patternrules: Use Windows-compatible quotingPaul Smith2020-01-031-1/+1
|
* [SV 56655] Allow pattern expansion to contain spacesPaul Smith2019-12-261-0/+8
| | | | | | | | | * src/dep.h: Add a new flag PARSEFS_ONEWORD * src/read.c (parse_file_seq): If PARSEFS_ONEWORD is given, treat the entire incoming string as a single pattern. * src/implicit.c (pattern_search): Pass PARSEFS_ONEWORD when parsing patterns for wildcards. * tests/scripts/features/patternrules: Add a new test.
* * job.c (child_error): Modify error message string.Paul Smith2019-09-221-1/+1
| | | | | | | | This reverts commit 6264deece3bb77798240a906ceed79097adbcf48. Further investigation discovers that the real issue is that GNU Emacs compile mode doesn't have a matching regex for GNU make error messages generated when targets fail. I submitted a patch to GNU Emacs adding a matcher for compile mode.
* [SV 54233] Preserve higher command_state values on also_make targets.Paul Smith2018-08-041-0/+16
| | | | | | | | | | | | | | If multiple pattern rules have the same pattern as also-make targets and we attempt to run them at the same time, we might downgrade the command state from 'running' to 'deps_running'; this will prevent that also_make from being considered complete causing make to wait forever for it to finish. Ensure that set_command_state never downgrades the state of a target. * src/file.c (set_command_state): Don't downgrade command_state. * src/filedef.h (struct file): Document the order prerequisite. * test/scripts/features/patternrules: Test the behavior.
* * job.c (child_error): Modify error message string.Paul Smith2017-10-301-1/+1
| | | | | Ensure Emacs compile-mode's next-error doesn't match target failure messages. Syntax errors in makefiles are still matched.
* Portability changes for the test suite.Paul Smith2016-12-261-5/+5
| | | | | | * tests/test_driver.pl: Save error strings for later comparison. * tests/run_make_tests.pl: Create portable commands for later use. * tests/*: Use these new variables.
* * job.c (child_error): Combine file info with error message.Paul Smith2016-03-201-2/+5
| | | | * tests/scripts/...: Update error message matches.
* Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.Paul Smith2012-03-041-2/+2
| | | | Fixes Savannah bug #34530.
* Bump the version to 3.82.90.Paul Smith2010-08-291-1/+2
| | | | | | Fix some doc bugs. Implement the --trace flag. Show filename/linenumber on error.
* Implement the shortest stem first search order for pattern-specific ↵Boris Kolpackov2009-09-281-0/+12
| | | | variables and pattern rules.
* - Rework secondary expansion so we only defer it if there's a possibilityPaul Smith2009-09-241-0/+18
| | | | | | it might be needed: for most situations we parse prereqs immediately as we used to. Reduces memory usage. - Fixes Savannah bug #18622.
* - Fix Savannah bug #19108Paul Smith2009-06-101-5/+35
| | | | | | | - Fix Savannah bug #17752 - Test suite: * When tests fail keep a "run" file containing the command invoked. * Support for the Valgrind "memcheck" and "massif" tools.
* - Modify access of config and gnulib Savannah modules to use GITPaul Smith2009-06-041-0/+15
| | | | | | | | | | | | | - Fix Savannah bug #24655. - Fix Savannah bug #24588. - Fix Savannah bug #24277. - Fix Savannah bug #25697. - Fix Savannah bug #25694. - Fix Savannah bug #25460. - Fix Savannah bug #26207. - Fix Savannah bug #25712. - Fix Savannah bug #26593. - Fix various doc issues.
* This is a major update, which switches virtually every allocated-but-not-freedPaul Smith2007-03-201-7/+7
| | | | | | | | | | | | | | | string into the strcache. As a side-effect, many more structure members and function arguments can/should be declared const. As mentioned in the changelog, unfortunately measurement shows that this change does not yet reduce memory. The problem is with secondary expansion: because of this we store all the prerequisites in the string cache twice. First we store the prerequisite string after initial expansion but before secondary expansion, then we store each individual file after secondary expansion and expand_deps(). I plan to change expand_deps() to be callable in either context (eval or snap_deps) then have non-second-expansion targets call expand_deps() during eval, so that we only need to store that dependency list once.
* Fixed bug #13022 by setting is_target flag on files that this implicitBoris Kolpackov2005-12-091-0/+30
| | | | pattern rule also makes.
* Various fixes and updates from testers of the beta3 release (mostly WindowsPaul Smith2005-07-041-7/+7
| | | | and OS/2 changes).
* Cleaned up some problems found with the tests running on a powerfulPaul Smith2005-06-271-1/+1
| | | | | | | Solaris system with an EMC NFS storage solution. Still get some odd errors here unfortunately related to sub-second timestamps that I just can't figure out. It all works if we run the tests in /tmp instead though :-/.
* Fixed Savannah bugs #13216 and #13218.Boris Kolpackov2005-05-311-0/+20
|
* Fixed Savannah bug #12267.Boris Kolpackov2005-03-101-0/+32
|
* Fixed Savannah bug #12202.Boris Kolpackov2005-03-041-3/+30
|
* Update the test template. A few fixes in run_make_test().Paul Smith2004-09-221-0/+40
Rename implicit_prereq_eval to patternrules, to be the start of a suite of tests of pattern rules.