Commit | Line | Data |
---|---|---|
1f00b0d6 S |
1 | #!/bin/sh |
2 | ||
9988b539 NC |
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 | ||
9988b539 NC |
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 | ||
12a67024 | 53 | if test X"\$TESTFILE" = X; then |
9988b539 NC |
54 | TESTFILE=TEST |
55 | fi | |
56 | ||
e75f8ea9 NC |
57 | if test X"\$PERL" = X; then |
58 | PERL=./perl$_exe | |
59 | export PERL | |
60 | fi | |
61 | ||
9988b539 | 62 | cd t |
9988b539 NC |
63 | |
64 | # The second branch is for testing without a tty or controlling terminal, | |
65 | # see t/op/stat.t | |
12a67024 | 66 | if test \$tty = Y; then |
9988b539 NC |
67 | \$PERL \$TESTFILE \$TEST_ARGS \$TEST_FILES </dev/tty |
68 | else | |
69 | PERL_SKIP_TTY_TEST=1 \$PERL \$TESTFILE \$TEST_ARGS \$TEST_FILES | |
70 | fi | |
6fa4dacc NC |
71 | |
72 | echo "Ran tests" > rantests | |
9988b539 NC |
73 | !GROK!THIS! |
74 | $eunicefix runtests | |
75 | chmod +x runtests |