summaryrefslogtreecommitdiff
path: root/tests/test_driver.pl
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2023-01-15 10:53:38 -0500
committerPaul Smith <psmith@gnu.org>2023-01-15 16:35:57 -0500
commitd2bf740e779cbbc599a664466a55be9fa5539a3e (patch)
treea7cc240f43c86fdfed27e682b5b011fe767bacc7 /tests/test_driver.pl
parenta8890796a439941bee9bc027b31430aec1b334e6 (diff)
downloadmake-git-d2bf740e779cbbc599a664466a55be9fa5539a3e.tar.gz
* tests/test_driver.pl: Convert z/OS answers for regex output
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.
Diffstat (limited to 'tests/test_driver.pl')
-rw-r--r--tests/test_driver.pl17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/test_driver.pl b/tests/test_driver.pl
index 38ec4587..38b848f2 100644
--- a/tests/test_driver.pl
+++ b/tests/test_driver.pl
@@ -908,9 +908,9 @@ sub compare_answer_vms
return 0;
}
-sub compare_answer_zos
+sub convert_answer_zos
{
- my ($kgo, $log) = @_;
+ my ($log) = @_;
# z/OS emits "Error 143" or "SIGTERM" instead of terminated
$log =~ s/Error 143/Terminated/gm;
@@ -920,7 +920,7 @@ sub compare_answer_zos
$log =~ s/EDC5129I No such file or directory\./No such file or directory/gm;
$log =~ s/FSUM7351 not found/not found/gm;
- return $log eq $kgo;
+ return $log;
}
sub compare_answer
@@ -939,10 +939,16 @@ sub compare_answer
$log =~ s,\r\n,\n,gs;
return 1 if ($log eq $kgo);
- # Keep these in case it's a regex
+ # Keep the originals in case it's a regex
$mkgo = $kgo;
$mlog = $log;
+ # z/OS has quirky outputs
+ if ($osname eq 'os390') {
+ $mlog = convert_answer_zos($mlog);
+ return 1 if ($mlog eq $kgo);
+ }
+
# Some versions of Perl on Windows use /c instead of C:
$mkgo =~ s,\b([A-Z]):,/\L$1,g;
$mlog =~ s,\b([A-Z]):,/\L$1,g;
@@ -956,9 +962,6 @@ sub compare_answer
# VMS is a whole thing...
return 1 if ($osname eq 'VMS' && compare_answer_vms($kgo, $log));
- # z/OS has its own quirks
- return 1 if ($osname eq 'os390' && compare_answer_zos($kgo, $log));
-
# See if the answer might be a regex.
if ($kgo =~ m,^/(.+)/$,) {
# Check the regex against both the original and modified strings