This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
valgrind doesn't require that perl was built with -g, so remove the check.
[perl5.git] / runtests.SH
CommitLineData
1f00b0d6
S
1#!/bin/sh
2
9988b539
NC
3case $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 ;;
13esac
14case "$0" in
15*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
16esac
17echo "Extracting runtests (with variable substitutions)"
18rm -f runtests
19$spitshell >runtests <<!GROK!THIS!
20$startsh -e
21# runtests.SH
22#
23
24export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$)
25
26case \$# in
27 0)
28 echo "runtests tty_flag ..."
29 exit 1
30 ;;
31esac
32
9988b539
NC
33case \$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 ;;
51esac
52
12a67024 53if test X"\$TESTFILE" = X; then
9988b539
NC
54 TESTFILE=TEST
55fi
56
e75f8ea9
NC
57if test X"\$PERL" = X; then
58 PERL=./perl$_exe
59 export PERL
60fi
61
9988b539 62cd t
9988b539
NC
63
64# The second branch is for testing without a tty or controlling terminal,
65# see t/op/stat.t
12a67024 66if test \$tty = Y; then
9988b539
NC
67 \$PERL \$TESTFILE \$TEST_ARGS \$TEST_FILES </dev/tty
68else
69 PERL_SKIP_TTY_TEST=1 \$PERL \$TESTFILE \$TEST_ARGS \$TEST_FILES
70fi
6fa4dacc
NC
71
72echo "Ran tests" > rantests
9988b539
NC
73!GROK!THIS!
74$eunicefix runtests
75chmod +x runtests