summaryrefslogtreecommitdiff
path: root/tests/scripts/features/errors
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2021-11-28 14:17:55 -0500
committerPaul Smith <psmith@gnu.org>2021-11-28 14:27:10 -0500
commite62f4cf9a2eaf71c0d0102c28280e52e3c169b99 (patch)
treedff8f5688f5fd1ecd31800b5080e601cfe22a91b /tests/scripts/features/errors
parent116767901f9fc22f837f2830dbd42ad57d70fcb1 (diff)
downloadmake-git-e62f4cf9a2eaf71c0d0102c28280e52e3c169b99.tar.gz
Special-case Windows error results
* tests/scripts/features/errors: Match Windows-specific errors. * tests/scripts/features/targetvars: Match Windows-specific errors. * tests/scripts/misc/general4: Match Windows-specific errors.
Diffstat (limited to 'tests/scripts/features/errors')
-rw-r--r--tests/scripts/features/errors27
1 files changed, 21 insertions, 6 deletions
diff --git a/tests/scripts/features/errors b/tests/scripts/features/errors
index f236d517..708123c9 100644
--- a/tests/scripts/features/errors
+++ b/tests/scripts/features/errors
@@ -31,6 +31,18 @@ all:
!,
'', "hi\nthere\n#MAKE#: *** [#MAKEFILE#:5: all] Error 1", 512);
+# Windows error look completely different :-/
+
+sub errors_getinfo
+{
+ my ($cmd, $args) = @_;
+ if ($port_type eq 'W32') {
+ return (2, "process_begin: CreateProcess(NULL, $cmd $args, ...) failed.\nmake (e=2): The system cannot find the file specified.");
+ }
+
+ return (127, "#MAKE#: $cmd: $ERR_no_such_file");
+}
+
# TEST #3
# -------
@@ -38,35 +50,38 @@ all:
my $unk = './foobarbazbozblat';
unlink($unk);
-my $err = $ERR_no_such_file;
+my $ernum, $erstr;
+($ernum, $erstr) = errors_getinfo($unk, "xx yy");
run_make_test(qq!
one: ; -$unk xx yy
-!,
- 'one', "$unk xx yy\n#MAKE#: $unk: $err\n#MAKE#: [#MAKEFILE#:2: one] Error 127 (ignored)\n");
+!, 'one',
+ "$unk xx yy\n$erstr\n#MAKE#: [#MAKEFILE#:2: one] Error $ernum (ignored)\n");
# TEST #4
# -------
+($ernum, $erstr) = errors_getinfo($unk, "aa bb");
run_make_test(qq!
two: ; $unk aa bb
!, 'two -i',
- "$unk aa bb\n#MAKE#: $unk: $err\n#MAKE#: [#MAKEFILE#:2: two] Error 127 (ignored)\n");
+ "$unk aa bb\n$erstr\n#MAKE#: [#MAKEFILE#:2: two] Error $ernum (ignored)\n");
# TEST #5
# -------
run_make_test(undef, 'two',
- "$unk aa bb\n#MAKE#: $unk: $err\n#MAKE#: *** [#MAKEFILE#:2: two] Error 127\n", 512);
+ "$unk aa bb\n$erstr\n#MAKE#: *** [#MAKEFILE#:2: two] Error $ernum\n", 512);
# SV #56918 : Test the unknown command as the second recipe line
+($ernum, $erstr) = errors_getinfo($unk, "qq rr");
run_make_test(qq!
three:
\t\@echo one
\t$unk qq rr
!, 'three',
- "one\n$unk qq rr\n#MAKE#: $unk: $err\n#MAKE#: *** [#MAKEFILE#:4: three] Error 127\n", 512);
+ "one\n$unk qq rr\n$erstr\n#MAKE#: *** [#MAKEFILE#:4: three] Error $ernum\n", 512);
# Try failing due to non-executable file