3 case $PERL_CONFIG_SH in
5 if test ! -f config.sh; then
7 ln ../../config.sh . || \
8 ln ../../../config.sh . || \
9 (echo "Can't find config.sh."; exit 1)
15 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
17 echo "Extracting runtests (with variable substitutions)"
20 $spitshell >runtests <<!GROK!THIS!
26 ## In the following, dollars and backticks do not need the extra backslash.
27 $spitshell >>runtests <<'!NO!SUBS!'
29 export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
31 # Avoid "warning: jobserver unavailable: using -j1." warnings under GNU make.
32 # When gmake -j N spawns a child, it passes
33 # MAKEFLAGS=" --jobserver-fds=3,4 -j".
34 # in the environment. Also, if make recognises that the child is another
35 # make (e.g. it's invoked as $(MAKE) or +command), it keeps open fd's 3
36 # and 4 to allow the child process to access the job server. Otherwise,
37 # those fd's aren't kept open.
38 # In the case where one does 'make -j 16 test_harness', this script is
39 # called with MAKEFLAGS set, but fd's 3 and 4 closed. Later when
40 # descendents of this script run cpan/ExtUtils-Constant/t/Constant.t
41 # which itelf invokes make, the warnings ensue.
43 if [ "x$MAKEFLAGS" != "x" ]; then
49 echo "runtests tty_flag ..."
62 if (true </dev/tty) >/dev/null 2>&1; then
69 echo "ttyflag should be one of tty, no-tty or choose"
74 if test X"$TESTFILE" = X; then
80 # If this is run under an old shell that doesn't automatically
81 # update PWD, then we must update it. Otherwise, t/io/fs.t gets
82 # mixed up about what directory we are in.
84 '') ;; # Do nothing if it isn't set at all.
85 */t) ;; # Leave it alone if it's properly updated.
86 *) PWD=${PWD}/t; export PWD ;; # Otherwise, fix it.
91 ## In the following, dollars and backticks do need the extra backslash.
92 $spitshell >>runtests <<!GROK!THIS!
93 # The second branch is for testing without a tty or controlling terminal,
95 if test \$tty = Y; then
96 ./perl$_exe \$TESTFILE \$TEST_ARGS \$TEST_FILES </dev/tty
98 PERL_SKIP_TTY_TEST=1 ./perl$_exe \$TESTFILE \$TEST_ARGS \$TEST_FILES
101 echo "Ran tests" > rantests