summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run.sh14
-rwxr-xr-xtests/tools/zos-gnu/od8
-rwxr-xr-xtests/tools/zos-gnu/sleep8
-rwxr-xr-xtests/tools/zos-gnu/sort8
-rwxr-xr-xtests/tools/zos-gnu/tr8
-rwxr-xr-xtests/tools/zos-gnu/wc8
6 files changed, 53 insertions, 1 deletions
diff --git a/tests/run.sh b/tests/run.sh
index c99ccff..2ef38c7 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -55,6 +55,18 @@ Linux) platform=linux ;;
OS/390) platform=zos ;;
*) platform=none ;;
esac
+# The .exp files were recorded with GNU tools. z/OS puts its own versions
+# first on PATH, so give the tests the GNU ones where they differ.
+if [ "$platform" = zos ]; then
+ PATH=$here/tools/zos-gnu:$PATH
+ export PATH
+fi
+# z/OS also adds to stderr what Linux never prints: the LE banner for every
+# process killed by a signal, and EDC message ids inside strerror() text.
+drop=
+if [ "$platform" = zos ]; then
+ drop='/^CEE5[0-9][0-9][0-9]S The signal SIG.* was received\.$/d;s/EDC[0-9][0-9][0-9][0-9]I //g'
+fi
# "\101" is "A" only if the shell was built for ASCII.
if [ "$("$shell" -c "printf '\\101'")" = A ]; then
ascii=1
@@ -100,7 +112,7 @@ for t in "$here"/posix/*.sh "$here"/scripts/*.sh "$here"/zash/*.sh \
continue
fi
# Error messages name the shell and script; make them comparable.
- sed -e "s|$t|SCRIPT|g" -e "s|$shell|SHELL|g" "$work/out" >"$work/got"
+ sed -e "s|$t|SCRIPT|g" -e "s|$shell|SHELL|g" -e "$drop" "$work/out" >"$work/got"
if cmp -s "$work/got" "${t%.sh}.exp"; then
pass=$((pass + 1))
[ "$verbose" = 1 ] && echo "ok $name"
diff --git a/tests/tools/zos-gnu/od b/tests/tools/zos-gnu/od
new file mode 100755
index 0000000..c721f79
--- /dev/null
+++ b/tests/tools/zos-gnu/od
@@ -0,0 +1,8 @@
+#!/bin/sh
+# The tests' expected output was recorded with GNU tools. z/OS ships
+# IBM versions first on PATH; the zopen package has GNU ones under a g
+# prefix. Use those, and fall back to the system tool when there is no
+# GNU copy. Copied under each name the tests need (see run.sh).
+tool=${0##*/}
+command -v "g$tool" >/dev/null 2>&1 && exec "g$tool" "$@"
+exec "/bin/$tool" "$@"
diff --git a/tests/tools/zos-gnu/sleep b/tests/tools/zos-gnu/sleep
new file mode 100755
index 0000000..c721f79
--- /dev/null
+++ b/tests/tools/zos-gnu/sleep
@@ -0,0 +1,8 @@
+#!/bin/sh
+# The tests' expected output was recorded with GNU tools. z/OS ships
+# IBM versions first on PATH; the zopen package has GNU ones under a g
+# prefix. Use those, and fall back to the system tool when there is no
+# GNU copy. Copied under each name the tests need (see run.sh).
+tool=${0##*/}
+command -v "g$tool" >/dev/null 2>&1 && exec "g$tool" "$@"
+exec "/bin/$tool" "$@"
diff --git a/tests/tools/zos-gnu/sort b/tests/tools/zos-gnu/sort
new file mode 100755
index 0000000..c721f79
--- /dev/null
+++ b/tests/tools/zos-gnu/sort
@@ -0,0 +1,8 @@
+#!/bin/sh
+# The tests' expected output was recorded with GNU tools. z/OS ships
+# IBM versions first on PATH; the zopen package has GNU ones under a g
+# prefix. Use those, and fall back to the system tool when there is no
+# GNU copy. Copied under each name the tests need (see run.sh).
+tool=${0##*/}
+command -v "g$tool" >/dev/null 2>&1 && exec "g$tool" "$@"
+exec "/bin/$tool" "$@"
diff --git a/tests/tools/zos-gnu/tr b/tests/tools/zos-gnu/tr
new file mode 100755
index 0000000..c721f79
--- /dev/null
+++ b/tests/tools/zos-gnu/tr
@@ -0,0 +1,8 @@
+#!/bin/sh
+# The tests' expected output was recorded with GNU tools. z/OS ships
+# IBM versions first on PATH; the zopen package has GNU ones under a g
+# prefix. Use those, and fall back to the system tool when there is no
+# GNU copy. Copied under each name the tests need (see run.sh).
+tool=${0##*/}
+command -v "g$tool" >/dev/null 2>&1 && exec "g$tool" "$@"
+exec "/bin/$tool" "$@"
diff --git a/tests/tools/zos-gnu/wc b/tests/tools/zos-gnu/wc
new file mode 100755
index 0000000..c721f79
--- /dev/null
+++ b/tests/tools/zos-gnu/wc
@@ -0,0 +1,8 @@
+#!/bin/sh
+# The tests' expected output was recorded with GNU tools. z/OS ships
+# IBM versions first on PATH; the zopen package has GNU ones under a g
+# prefix. Use those, and fall back to the system tool when there is no
+# GNU copy. Copied under each name the tests need (see run.sh).
+tool=${0##*/}
+command -v "g$tool" >/dev/null 2>&1 && exec "g$tool" "$@"
+exec "/bin/$tool" "$@"