| 1 | #!/bin/sh |
| 2 | |
| 3 | case $PERL_CONFIG_SH in |
| 4 | '') |
| 5 | if test ! -f config.sh; then |
| 6 | ln ../config.sh . || \ |
| 7 | ln ../../config.sh . || \ |
| 8 | ln ../../../config.sh . || \ |
| 9 | (echo "Can't find config.sh."; exit 1) |
| 10 | fi 2>/dev/null |
| 11 | . ./config.sh |
| 12 | ;; |
| 13 | esac |
| 14 | case "$0" in |
| 15 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
| 16 | esac |
| 17 | echo "Extracting runtests (with variable substitutions)" |
| 18 | rm -f runtests |
| 19 | $spitshell >runtests <<!GROK!THIS! |
| 20 | $startsh -e |
| 21 | # runtests.SH |
| 22 | # |
| 23 | |
| 24 | export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) |
| 25 | |
| 26 | case \$# in |
| 27 | 0) |
| 28 | echo "runtests tty_flag ..." |
| 29 | exit 1 |
| 30 | ;; |
| 31 | esac |
| 32 | |
| 33 | case \$1 in |
| 34 | tty) |
| 35 | tty=Y |
| 36 | ;; |
| 37 | no-tty) |
| 38 | tty=N |
| 39 | ;; |
| 40 | choose) |
| 41 | if (true </dev/tty) >/dev/null 2>&1; then |
| 42 | tty=Y |
| 43 | else |
| 44 | tty=N |
| 45 | fi |
| 46 | ;; |
| 47 | *) |
| 48 | echo "ttyflag should be one of tty, no-tty or choose" |
| 49 | exit 1 |
| 50 | ;; |
| 51 | esac |
| 52 | |
| 53 | if test X"\$TESTFILE" = X; then |
| 54 | TESTFILE=TEST |
| 55 | fi |
| 56 | |
| 57 | cd t |
| 58 | |
| 59 | # The second branch is for testing without a tty or controlling terminal, |
| 60 | # see t/op/stat.t |
| 61 | if test \$tty = Y; then |
| 62 | ./perl$_exe \$TESTFILE \$TEST_ARGS \$TEST_FILES </dev/tty |
| 63 | else |
| 64 | PERL_SKIP_TTY_TEST=1 ./perl$_exe \$TESTFILE \$TEST_ARGS \$TEST_FILES |
| 65 | fi |
| 66 | |
| 67 | echo "Ran tests" > rantests |
| 68 | !GROK!THIS! |
| 69 | $eunicefix runtests |
| 70 | chmod +x runtests |