summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* [SV 63219] Support an "unload" function for loaded objectsPaul Smith2023-05-141-0/+89
| | | | | | | | | | | | | | | | | | | | If a loaded object defines a symbol <object>_gmk_unload, assume it's a function and invoke it whenever the loaded object is unloaded. Original implementation by Dmitry Goncharov <dgoncharov@users.sf.net> * NEWS: Announce the change. * doc/make.texi: Describe the behavior. * src/gnumake.h: Add information to the comments. * src/makeint.h (unload_all): Declare a new function. * src/main.c (die): Invoke unload_all(). * src/load.c (unload_func_t): Declare a new type for unload. (struct load_list): Remember the unload symbol if it exists. (load_object): Move the parsing of the object name from load_file. Check for the _gmk_unload symbol and if found, remember it. (load_file): Allow load_object to do object filename parsing. (unload_file): Remove the load_list entry when unloading the object. (unload_all): Unload all the loaded objects. * tests/scripts/features/loadapi: Test the unload function.
* Remove the "preview" status from the loaded object featurePaul Smith2023-05-072-6/+6
| | | | | | | | | | | | | | | | Add an ABI version both to the header file and passed to the setup function. Unfortunately this itself is an ABI break and I couldn't find a good way to avoid it. * NEWS: Announce the ABI is not a preview and the incompatibility. * doc/make.texi: Remove the preview warnings for object loading. Document the new ABI version argument. * src/gnumake.h (GMK_ABI_VERSION): Set the ABI version to 1. Add comments documenting the format of the setup function. * src/load.c (setup_func_t): Rename from load_func_t. (load_file): Pass the ABI version to the setup function. * tests/scripts/features/load: Rework the setup function. * tests/scripts/features/loadapi: Ditto.
* * src/read.c (eval): [SV 40942] Allow targets named "load"Paul Smith2023-05-071-1/+19
| | | | | | | Previously "load:" worked but "load :" failed. Allow the latter as well. This doesn't fix all issues; "load foo :" is still treated as a load operation for "foo" and ":". Avoids SV 50413 as well. * tests/scripts/features/load: Write tests.
* * tests/test_driver.pl: Show info about failed testsPaul Smith2023-05-071-26/+36
| | | | | Remove working directories for skipped tests. We use different directories per test so don't keep rmfiles.
* * tests/scripts/features/comments: Add missing "1;"Paul Smith2023-05-061-1/+3
|
* [SV 64124] Avoid use-after-free in expand_variable_buf()Dmitry Goncharov2023-04-301-0/+26
| | | | | | | | | | | When the expanded value of the variable in buf occupies more space than available in variable_buffer, function variable_buffer_output reallocates variable_buffer: return a pointer into the new memory, not the old memory. * src/expand.c (expand_variable_buf): Preserve the offset of buf and return that offset into the (potentially reallocated) buffer. * tests/scripts/features/expand: Add tests.
* [SV 64115] Suppress warnings about undefined GNUMAKEFLAGSDmitry Goncharov2023-04-301-0/+11
| | | | | * src/variable.c (defined_vars): Add GNUMAKEFLAGS to defined variables. * tests/scripts/options/warn: Add a test.
* [SV 64107] Disable builtins immediately on -R or -rDmitry Goncharov2023-04-302-3/+62
| | | | | | | | | | | Disable builtin variables and rules immediately, when -R or -r is added to MAKEFLAGS inside the makefile. * src/main.c (disable_builtins): Add new function disable_builtins(). (main): Call disable_builtins(). (reset_makeflags): Call disable_builtins(). * tests/scripts/options/dash-r: Add tests. * tests/scripts/variables/MAKEFLAGS: Update tests.
* * tests/scripts/features/double_colon: Test parallel double-colon rulesPaul Smith2023-04-301-1/+10
| | | | Original test proposed by Dmitry Goncharov <dgoncharov@users.sf.net>
* tests: Run each file in a separate directoryPaul Smith2023-04-0210-171/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid cross-contamination between test files by creating a new working directory for each file, and setting it as the current directory before starting the tests in that file. Rename the test output as tNNN.{base,log,diff,mk} where NNN is a test number starting with 001 for the first test. It is slightly more annoying to find diff files since you can't use autocomplete directly but it is simpler to match things. Detect the source directory as the location of the test_driver.pl script, so remove the separate -srcdir option. * Makefile.am: Remove hacks to create symlinks when building out-of-tree, and remove -srcdir option from run_make_tests. * tests/test_driver.pl: Locate $srcpath based on __FILE__, then compute $toppath as its parent. Set $scriptpath under $srcpath and $workpath under the current directory. Toss $*_filename and modify get_logfile() etc. to use the suffix directly. Add a chdir() around the invocation of the test. * tests/run_make_tests.pl: Throw out the -srcdir option and use $srcpath set in test_driver.pl. The #WORK# helper is no longer useful so remove it. Set #PWD# to the current working dir. Always search the local directory and $srcpath for config-flags.pm. Use $srcpath for finding the thelp.pl script. * tests/scripts/features/vpath: Don't put things in work/ as it is no longer a subdirectory. * tests/scripts/features/vpathgpath: Ditto. * tests/scripts/features/vpathplus: Ditto. * tests/scripts/misc/general1: Ditto. * tests/scripts/misc/general2: Ditto. * tests/scripts/options/dash-k: Ditto. * tests/scripts/options/symlinks: Use $testpath as the working directory. * tests/scripts/variables/GNUMAKEFLAGS: Use the test helper to display env var values (grepping for GNUMAKEFLAGS finds extra things now that it is our current working directory).
* * tests/scripts/targets/WAIT: Add whitespace to avoid W32 issuesPaul Smith2023-04-021-72/+72
| | | | | On Windows systems, "X:" for any "X" is considered a drive letter so add whitespace.
* [SV 63856] Fix pruning of double-colon rulesDmitry Goncharov2023-04-021-0/+339
| | | | | | | | | | | | | | | | | | | | | | | | Given this setup: $ cat Makefile A::; @echo A-1 && sleep 1 && echo A-1 done A::; @echo A-2 && sleep 1 && echo A-2 done A::; @echo A-3 && sleep 1 && echo A-3 done B::; @echo B-1 && sleep 1 && echo B-1 done B::; @echo B-2 && sleep 1 && echo B-2 done B::; @echo B-3 && sleep 1 && echo B-3 done $ make -j8 A .WAIT B All recipes for A should be started sequentially and complete before any recipe for B is started, then all recipes for B should be started sequentially. This wasn't happening because the double-colon target was getting pruned too early. * src/remake.c (update_file): Don't prune a target if it's a double colon rule which is complete, but there are other recipes to run for this target: we want those other recipes to be run first. * tests/scripts/targets/WAIT: Test .WAIT with double colon rules.
* [SV 63856] Implement .WAIT on the command lineDmitry Goncharov2023-04-021-0/+109
| | | | | | | | | * src/main.c (handle_non_switch_argument): Return 1 if arg is .WAIT. (decode_switches): Set wait_here for a goal that follows .WAIT. * src/remake.c (update_goal_chain): Honor wait_here for a command line goal. Don't allow double-colon targets to continue if .WAIT is given for one of them. * tests/scripts/targets/WAIT: Add .WAIT tests.
* [SV 63981] Don't warn on explicit -j1Paul Smith2023-04-021-2/+14
| | | | | | | If -j1 is given explicitly on the command line don't warn about it. * src/main.c (main): Skip the warning if -j1. * tests/scripts/features/jobserver: Add a test for this behavior.
* Adjust output strings to be alignedPaul Smith2023-04-0214-38/+44
| | | | | | | | 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.
* Add support for .WARNINGS special variablePaul Smith2023-04-022-11/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new special variable, .WARNINGS, to allow per-makefile control over warnings. The command line settings will override this. Move the handling of warning flags to a new file: src/warning.c. Allow the decode to work with generic strings, and call it from decode_switches(). * Makefile.am: Add new file src/warning.c. * build_w32.bat: Ditto. * builddos.bat: Ditto. * po/POTFILES.in: Ditto. * src/makeint.h: #define for the .WARNINGS variable name. * src/warning.h: Add declarations for methods moved from main.c. Rename the enum warning_state to warning_action. * src/warning.c: New file. Move all warning encode/decode here from main.c. * src/main.c: Move methods into warning.c and call those methods instead. (main): Set .WARNINGS as a special variable. * src/job.c (construct_command_argv): Rename to warning_action. * src/read.c (tilde_expand): Ditto. * src/variable.c (set_special_var): Update warnings when the .WARNINGS special variable is set. * tests/scripts/options/warn: Check invalid warning options. * tests/scripts/variables/WARNINGS: Add tests for the .WARNINGS special variable.
* Add new warnings invalid-var and invalid-refPaul Smith2023-04-011-2/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | The "invalid-var" warning triggers if the makefile attempts to assign a value to an invalid variable name (a name containing whitespace). The "invalid-ref" warning triggers if the makefile attempts to reference an invalid variable name. Both new warnings have a default action of "warn". * NEWS: Add these new warnings. * doc/make.1: Document them in the man page. * doc/make.texi (Warnings): Document them in the user's manual. * src/warning.h: Add enum values for the new warning types. * src/main.c (initialize_warnings): Initialize the new warnings. * src/variable.h (undefine_variable_in_set, undefine_variable_global): Ask callers to provide a struct floc specifying where the variable is undefined. * src/read.c (do_undefine): Pass floc when undefining. * src/variable.c (check_valid_name): If invalid-var is enabled, check the variable name. (define_variable_in_set): Call it. (undefine_variable_in_set): Ditto. (check_variable_reference): If invalid-ref is enabled, check the variable reference. (lookup_variable): Call it. (lookup_variable_in_set): Ditto. * tests/scripts/options/warn: Add tests for the new warning types.
* Introduce a --warn command line optionPaul Smith2023-04-013-56/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the singleton --warn-undefined-variables with infrastructure to manage multiple warnings: the --warn option can take an action "ignore", "warn", or "error" (which will apply to all warnings), or a specific warning type and an action for that type. Multiple options can be provided and are consolidated. * NEWS: Announce the new option. * doc/make.1: Document in the man page. * doc/make.texi (Warnings): Document in the user's manual. * Makefile.am: Add new header warning.h. * src/warning.h: Define enum for actions and warning types, and macros to test whether they are set. Keep the default settings separate so that we can correctly reconstruct MAKEFLAGS. * src/makeint.h: Remove deprecated warn_undefined_variables_flag. * src/main.c: Create global variables to hold warning settings. (switches): Add a new switch for --warn. (initialize_warnings): Set the default warning actions. (main): Call initialize_warnings(). (encode_warning_state, decode_warning_state): Convert warning states between strings and enums. (encode_warning_name, decode_warning_name): Convert warning names between strings and enums. (decode_warn_flags): Convert a --warn option into enum values. If deprecated warn_undefined_variables_flag is set convert it to --warn. (decode_switches): Don't remove duplicates of --warn since order matters. Call decode_warn_flags() to handle --warn. (define_makeflags): Special-case handling of --warn options written to MAKEFLAGS: write out the current settings. * src/read.c (tilde_expand): Use new warning control macros. * src/variable.c (warn_undefined): Ditto. * src/job.c (construct_command_argv): Ditto. * tests/scripts/options/warn: Rename from warn-undefined-variables and add tests for --warn. * tests/scripts/variables/MAKEFLAGS: Expect the new behavior.
* Clean up memory leak warnings from ASAN and ValgrindPaul Smith2023-04-016-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | * src/main.c (main): Add "sanitize" to .FEATURES if ASAN is enabled. * src/expand.c (expand_variable_output): Remember "recursive" setting in case it's changed by the expansion of the variable. * src/file.c (rehash_file): If we drop a file from the global 'files' hash, remember it in rehashed_files. We can't free it because it's still being referenced (callers will invoke check_renamed()) but it will be a leak since it's no longer referenced by 'files'. * src/remake.c (update_file_1): If we drop a dependency, remember it in dropped_list. We can't free it because it's still being referenced by callers but it will be a leak since it's no longer referenced as a prerequisite. * tests/scripts/functions/guile: Don't run Guile tests when ASAN is enabled. * tests/scripts/functions/wildcard: Enabling ASAN causes glob(3) to break! Don't run this test. * tests/scripts/features/exec: Valgrind's exec() doesn't support scripts with no shbang. * tests/scripts/jobserver: Valgrind fails if TMPDIR is set to an invalid directory: skip those tests. * tests/scripts/features/output-sync: Ditto. * tests/scripts/features/temp_stdin: Ditto.
* Directly handle $\ line endingsPaul Smith2023-02-262-30/+28
| | | | | | | | | | | | | | Previously we used the fact that this line ending expanded to "$ " which would then expand to the empty string. This has problems if you enable warnings for undefined variables, so directly implement this special (but documented) trick in the GNU Make parser. As a side-effect this also removes all previous whitespace when in GNU Make mode (not in POSIX mode) just as it would without "$". * src/misc.c (collapse_continuations): Check for "$\" and remove it. * tests/scripts/variables/flavors: Add regression tests including with previous whitespace, and escaped/unescaped "$"
* * tests/scripts/options/dash-l: Simplify the test via the helperPaul Smith2023-02-262-22/+31
| | | | * tests/thelp.pl: Add "exist" and "noexist" operators.
* Use a recursive environment if any command needs itPaul Smith2023-02-211-0/+36
| | | | | | | | | We only create one target environment for all commands in a recipe. Ensure it's set for recursive make if ANY command is recursive, not just the first one. * src/job.c (start_job_command): Check for any recursive command. * tests/scripts/features/jobserver: Test recursion on second line.
* [SV 63821] Don't set up default suffix rules if makefile sets -rDmitry Goncharov2023-02-201-0/+65
| | | | | | | | | | | When built-in rules are disabled by adding -r to MAKEFLAGS in the makefile, don't add suffix rules at all so that if suffixes are added back via .SUFFIXES, the rules are still not there. * src/main.c (main): Set default suffix rules after parsing makefiles. * src/default.c (install_default_suffix_rules): Install a default suffix rule only if there is no user defined rule. * tests/scripts/features/suffixrules: Add tests.
* * tests/scripts/misc/general4: Only test empty PATH on UNIXPaul Smith2023-02-202-5/+6
|
* * tests/scripts/features/include [AIX]: Set explicit timestampsPaul Smith2023-02-191-3/+5
|
* * tests/scripts/features/archives: Set CC properlyPaul Smith2023-02-191-3/+3
|
* Clean up depth handling in debug outputPaul Smith2023-02-191-15/+25
| | | | | | | | | | | | | | The indentation shown in debug output was misleading. Increment the depth when we are working on a prerequisite, not for the current target. * src/remake.c (check_dep): Increment depth only on recursion. (update_file_1): Ditto. Don't show "Finished..." if prereqs are still running. * src/implicit.c (pattern_search): Increment depth for the entire search. * tests/scripts/features/output-sync: Support debug output when run by hand.
* Allow jobserver style to be forced to "pipe"Paul Smith2023-02-191-0/+1
| | | | | | | | | | | | | | Some systems that support mkfifo() don't support the usage that GNU make wants. Provide a way to force using "pipe" jobserver mode even when mkfifo() is available. * src/makeint.h (MK_OS_HURD): Define if we're on Hurd. (JOBSERVER_USE_FIFO): Define if we have mkfifo() and we're NOT on Hurd. * src/main.c (main): Test JOBSERVER_USE_FIFO not HAVE_MKFIFO. * src/posixos.c (jobserver_setup): Ditto. * maintMakefile: Create a config check test for forcing "pipe" mode. * tests/run_make_tests.pl: Show discovered FEATURES in verbose mode.
* * tests/scripts/variables/MAKEFLAGS: Fix some Perl warningsPaul Smith2023-02-041-34/+38
|
* [SV 63667] In .POSIX, use shell flags -c when ignoring errorsPaul Smith2023-01-281-2/+42
| | | | | | | | | | | * src/variable.c (lookup_variable_for_file): New function to retrieve a variable assignment in a file context. * src/variable.h (lookup_variable_for_file): Declare it. * src/job.c (construct_command_argv): Look up .SHELLFLAGS. If .POSIX is set and we're using the default value, choose -c if we're ignoring errors else choose -ec. (construct_command_argv_internal): Ditto. * tests/scripts/targets/POSIX: Add tests.
* * tests/scripts/features/archives: [SV 63688] Quote cmd line varsDmitry Goncharov2023-01-281-4/+5
|
* * tests/test_driver.pl: Convert z/OS answers for regex outputPaul Smith2023-01-153-20/+22
| | | | | | Allow z/OS customizations to apply to regex output matching. * tests/scripts/features/output-sync: Use a regex for Terminated. * tests/scripts/features/temp_stdin: Ditto.
* * tests/scripts/features/archives: Use the configured compiler for CCPaul Smith2023-01-151-1/+4
|
* * tests/scripts/features/reinvoke: Warn about closing STDIN.Paul Smith2023-01-113-1/+6
| | | | | * tests/scripts/features/temp_stdin: Ditto. * tests/scripts/options/dash-f: Ditto.
* [SV 17448] Ignore whitespace around $(file ...) namesPaul Smith2023-01-082-4/+14
| | | | | | | | | | The other issues related to whitespace reported in this bug are not addressed by this change. * src/functions.c (func_file): Strip whitespace from the start and end of the filename provided to the $(file ...) function. * tests/scripts/functions/file: Add tests for this. * tests/test_driver.pl: Use 3-arg version of open().
* [SV 61218] Ensure MAKEFLAGS is expanded even with -ePaul Smith2023-01-081-3/+12
| | | | | | | | | | | | | | If -e was given we weren't expanding MAKEFLAGS before passing it through the environment to jobs: we don't expand variables we receive from the environment and when -e is given we set the origin of MAKEFLAGS to "environment override". Check for MAKEFLAGS specifically, which seems like a hack but I don't have a better idea offhand. * src/main.c (main): Drive-by: use o_default for MAKEOVERRIDES. * src/variable.c (target_environment): Always expand MAKEFLAGS regardless of the origin type. * tests/scripts/options/dash-e: Create a test.
* [SV 62654] Support GNU Make on z/OSPaul Smith2023-01-0811-29/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original patches provided by Igor Todorovski <itodorov@ca.ibm.com> Reworked by Paul Smith <psmith@gnu.org>. Thanks to IBM for providing a test system. * NEWS: Announce support. * AUTHORS: Ditto. * README.zOS: Provide details on building GNU Make on z/OS. * build.sh (get_mk_var): z/OS sh has a strange bug which causes it to generate extra lines of output: rework the function to print output as we compute it instead of collecting it into a variable, which works around this bug. * src/makeint.h: Declare MK_OS_ZOS if we're building for z/OS. * src/arscan.c: Don't include <ar.h> on z/OS. * src/job.c: We can't change environ in ASCII mode on z/OS. * src/main.c: Ditto. Also we can't use pselect() on z/OS. * src/posixos.c: pselect() seems to hang on z/OS: don't use it. * tests/run_make_tests.pl: Handle different exit codes on z/OS. * tests/test_driver.pl: Preserve some special z/OS env.vars. Add special checks to output comparisons when on z/OS. * tests/scripts/features/archives: Don't validate names. Don't try to compile empty files as IBM compilers complain. * tests/scripts/features/shell_assignment: Fix octal value of #. * tests/scripts/features/temp_stdin: Don't print "term". * tests/scripts/functions/shell: Handle shell exit codes. * tests/scripts/targets/ONESHELL: Ditto. * tests/scripts/targets/POSIX: sh -x prints differently. * tests/scripts/variables/SHELL: Ditto.
* [SV 63609] Avoid buffer overrun in --warn-undefined-variablesPaul Smith2023-01-031-0/+11
| | | | | | | | | Reported by Dmitry Goncharov <dgoncharov@users.sf.net> * src/variable.c (struct defined_vars): Create a struct that holds the name and length of each variable name. (warn_undefined): Check the lengths before comparing the contents. * tests/scripts/options/warn-undefined-variables: Add a test.
* [SV 14927] Allow parallel builds for archivesPaul Smith2023-01-031-3/+33
| | | | | | | | | | | | | | Compare the timestamp of the object file (if it exists) with the archived object and if the object file is newer, ensure it's updated in the archive. * NEWS: Announce the new capability. * doc/make.texi (Dangers When Using Archives): Explain how to enable parallel builds with archives. * src/remake.c (f_mtime): For archive element files check the mod time of the object file (if it exists) against the archive object (if it exists). * tests/scripts/features/archives: Add tests for this capability.
* [SV 61463] Don't export inherited private variablesPaul Smith2023-01-022-1/+67
| | | | | | | | | | | If a parent target has an exported variable that is private, don't export it in child targets. * NEWS: Mention this change. * src/variable.c (target_environment): Ignore private inherited variables. * tests/thelp.pl: Add a new "env" operation to show env.var. values. * tests/scripts/variables/private: Verify this new behavior.
* Convert references from "GNU make" to "GNU Make"Paul Smith2023-01-0116-23/+23
|
* Update the copyright year on all filesPaul Smith2023-01-018-8/+8
|
* Apply spelling fixes discovered by CodespellPaul Smith2022-12-319-12/+12
| | | | | | | | | | | | | | | | | | * 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
* Avoid using false(1) in regression testsPaul Smith2022-12-315-47/+32
| | | | | | | | | | | | The POSIX standard only requires false(1) to return a "non-zero" exit code; almost all systems return 1 but some (Solaris!!!) return 255 or possibly even other values. Use our helper "fail" instead. * tests/thelp.pl: Have the "fail" command obey -q. * tests/scripts/features/parallelism: Helper -q no longer prints fail. * tests/scripts/targets/POSIX: Replace false with #HELPER# -q fail 1. * tests/scripts/variables/MAKEFLAGS: Ditto. * tests/scripts/variables/SHELL: Ditto.
* [SV 63439, SV 63452] Don't warn on undefined internal variablesPaul Smith2022-12-241-0/+13
| | | | | | | | | | | | | | | | | Don't generate undefined variable warnings for variables that are internal / special to make and where the empty string is valid. Rather than defining them to empty, which could introduce unwanted behavior, keep a list of variable names which we should never warn about. * src/variable.h (warn_undefined): Convert the macro to a function. * src/variable.c (defined_vars): Always "defined" variable names. (warn_undefined): Implement as a function and check against the defined_vars before generating a warning. * src/read.c (read_all_makefiles): No need to reset warning flag. * src/vpath.c (build_vpath_lists): Ditto. * tests/scripts/options/warn-undefined-variables: Expand all the pre-defined variables to ensure warnings are not generated.
* [SV 63552] Change directories before constructing include pathsPaul Smith2022-12-241-45/+31
| | | | | | | | | | | | | | * src/makeint.h (reset_makeflags): New function to handle changing MAKEFLAGS from within makefiles. Remove decode_env_switches(). * src/variable.c (set_special_var): Call reset_makeflags() instead of various internal methods. * src/main.c (decode_env_switches): Only internal now so make static. (decode_switches): Don't invoke construct_include_path() yet. (reset_makeflags): Decode env switches and construct include paths. (main): Construct include paths after we process -C options. * tests/scripts/options/dash-C: Rewrite to use new test constructs. Add a test using both -C and -I together. Add a test for multiple -C options.
* tests [WINDOWS32]: Support Strawberry Perl on WindowsPaul Smith2022-12-2010-35/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Strawberry Perl has some different behaviors from ActiveState Perl which impact the test suite: - Avoid Perl's chomp() as it may not remove CRs; chomp() may remove only the final NL but not the CR in a CRNL line ending. - Strawberry Perl doesn't support ActiveState's system(1, ...) form. - Strawberry Perl (or msys?) does something weird with "/tmp" when provided to exec(), replacing it with the user's %TEMP%. - Strawberry Perl uses msys paths like /c/foo instead of C:\foo. * tests/test_driver.pl (get_osname): Strawberry Perl uses 'msys' as its $^O so if we see that use a port of 'W32'. (_run_with_timeout): Strawberry Perl doesn't support the special system(1, ...) form of system() so use POSIX standard fork/exec. (compare_answer): Paths generated by Strawberry Perl use msys path format (e.g., /c/foo instead of C:\foo); check for those differences and compare RE against both the unmodified and modified log. * tests/run_make_tests.pl (set_defaults): Switch from chomp to s/// to remove CRNL and NL line endings. * tests/scripts/features/errors: Executing directories on Strawberry will give an error; translate it to Windows error output format. * tests/scripts/features/output-sync: Ditto. * tests/scripts/features/temp_stdin: Ditto. * tests/scripts/functions/realpath: Ditto. * tests/scripts/options/dash-I: Ditto. * tests/scripts/variables/INCLUDE_DIRS: Ditto. * tests/scripts/misc/close_stdout: /dev/full is reported as existing on Strawberry Perl, but it doesn't do anything. Skip the test. * tests/scripts/variables/MAKEFLAGS: When an argument containing /tmp is passed to a program via exec(), something replaces it with the expansion of the %TEMP% variable. Instead of using /tmp create a local directory to use.
* * tests/test_driver.pl: Remember if something failed and report itPaul Smith2022-12-201-0/+12
|
* [SV 63537] Document and test flippable switchesDmitry Goncharov2022-12-182-4/+528
| | | | | | | | | | | | | | | | | | * doc/make.texi (Options/Recursion): Clarify that MAKEFLAGS values from the environment have precedence over those set in the makefile. * tests/scripts/variables/MAKEFLAGS: Check boolean switches -k/-S, -w/--no-print-directory and -s/--no-silent as follows: 1. A switch can be enabled or disabled on the command line. 2. A switch can be enabled or disabled in env. 3. A switch can be enabled or disabled in makefile. 4. Command line beats env and makefile. 5. Env beats makefile. 6. MAKEFLAGS contains each specified switch at parse and build time. 7. If switches are specified in multiple origins, MAKEFLAGS contains the winning switch at parse and build time. 8. MAKEFLAGS does not contain the losing switch. Also test that --debug settings from different origins are combined together into one option.
* [SV 63484] Force included makefiles to be explicitDmitry Goncharov2022-12-181-0/+15
| | | | | | | | | Ensure included makefiles are not treated as intermediate, even if they are created by an implicit rule. Reported by Patrick Oppenlander <patrick.oppenlander@gmail.com>. * src/read.c (eval_makefile): Mark makefiles as explicit. * tests/scripts/features/include: Add a test.