]> git.ipfire.org Git - thirdparty/make.git/commit
tests [WINDOWS32]: Support Strawberry Perl on Windows
authorPaul Smith <psmith@gnu.org>
Mon, 19 Dec 2022 05:24:42 +0000 (00:24 -0500)
committerPaul Smith <psmith@gnu.org>
Tue, 20 Dec 2022 07:14:18 +0000 (02:14 -0500)
commita581146562009407649b85fac48f4e7cafe5eaa0
treea49b891804f21ad6d38f83392abc7eeb16268902
parentb2c74460237f7609564bc80641acff9cf6cb0f7d
tests [WINDOWS32]: Support Strawberry Perl on Windows

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/run_make_tests.pl
tests/scripts/features/errors
tests/scripts/features/output-sync
tests/scripts/features/temp_stdin
tests/scripts/functions/realpath
tests/scripts/misc/close_stdout
tests/scripts/options/dash-I
tests/scripts/variables/INCLUDE_DIRS
tests/scripts/variables/MAKEFLAGS
tests/test_driver.pl