summaryrefslogtreecommitdiff
path: root/runtests.SH
blob: 304b7195e86aa87a632c172ea1317ff167e29fc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh

case $PERL_CONFIG_SH in
'')
    if test ! -f config.sh; then
	ln ../config.sh . || \
	ln ../../config.sh . || \
	ln ../../../config.sh . || \
	(echo "Can't find config.sh."; exit 1)
    fi 2>/dev/null
    . ./config.sh
    ;;
esac
case "$0" in
*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac
echo "Extracting runtests (with variable substitutions)"
rm -f runtests
$spitshell >runtests <<!GROK!THIS!
$startsh -e
# runtests.SH
# 

export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)

case \$# in
    0)
	echo "runtests tty_flag ..."
	exit 1
	;;
esac

case \$1 in
    tty)
	tty=Y
	;;
    no-tty)
	tty=N
	;;
    choose)
	if (true </dev/tty) >/dev/null 2>&1; then
	    tty=Y
	else
	    tty=N
	fi
	;;
    *)
	echo "ttyflag should be one of tty, no-tty or choose"
	exit 1
	;;
esac

if test X"\$TESTFILE" = X; then
    TESTFILE=TEST
fi

cd t

# The second branch is for testing without a tty or controlling terminal,
# see t/op/stat.t
if test \$tty = Y; then
    ./perl$_exe \$TESTFILE \$TEST_ARGS \$TEST_FILES </dev/tty
else
    PERL_SKIP_TTY_TEST=1 ./perl$_exe \$TESTFILE \$TEST_ARGS \$TEST_FILES
fi

echo "Ran tests" > rantests
!GROK!THIS!
$eunicefix runtests
chmod +x runtests