#!/bin/sh # Run the z/OS tests that need tso(1) and data sets on Linux, with the # stand-ins in this directory, against the shell named: # # sh tests/tools/zos-stubs/run.sh ./zash # # This checks the shell side of those tests (quoting, pipes, statuses, # cleanup) before they reach a real system; it says nothing about z/OS. here=$(cd "$(dirname "$0")" && pwd) tests=$(cd "$here/../.." && pwd) shell=$1 case $shell in /*) ;; *) shell=$PWD/$shell ;; esac ZOS_STUB_STORE=${TMPDIR:-/tmp}/zos-stub-store.$$ export ZOS_STUB_STORE work=${TMPDIR:-/tmp}/zos-stub-work.$$ trap 'rm -rf "$work" "$ZOS_STUB_STORE"' EXIT status=0 for t in datasets tso; do rm -rf "$work"; mkdir -p "$work" (cd "$work" && PATH=$here:$PATH TSH=$shell "$shell" "$tests/zos/$t.sh" \ >out 2>&1; echo "[status $?]" >>out) if diff "$tests/zos/$t.exp" "$work/out" >/dev/null; then echo "zos/$t: ok (stand-ins)" else echo "zos/$t: FAILED"; diff "$tests/zos/$t.exp" "$work/out" | sed 's/^/ /' status=1 fi done exit $status