work around problems with old perl

This commit is contained in:
tg 2008-04-01 17:22:54 +00:00
parent 18f38ad75a
commit 5198f4c358
2 changed files with 33 additions and 7 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.309 2008/04/01 17:14:31 tg Exp $' srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.310 2008/04/01 17:22:53 tg Exp $'
#- #-
# Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS # Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI # CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI
@ -1227,6 +1227,7 @@ case $curdir in
esac esac
cat >>test.sh <<-EOF cat >>test.sh <<-EOF
export PATH='$PATH' export PATH='$PATH'
check_categories=$check_categories
print Testing mksh for conformance: print Testing mksh for conformance:
fgrep MirOS: '$srcdir/check.t' fgrep MirOS: '$srcdir/check.t'
fgrep MIRBSD '$srcdir/check.t' fgrep MIRBSD '$srcdir/check.t'
@ -1235,8 +1236,11 @@ cat >>test.sh <<-EOF
perl=perl5 perl=perl5
\$perl -e print >/dev/null 2>&1 || perl=perl \$perl -e print >/dev/null 2>&1 || perl=perl
\$perl -e print >/dev/null 2>&1 || exit 1 \$perl -e print >/dev/null 2>&1 || exit 1
print '\\ufeffprint "moien";' >test.tmp
[[ \$(\$perl test.tmp 2>&1) = moien ]] || \\
check_categories=\$check_categories,oldish-perl
exec \$perl '$srcdir/check.pl' -s '$srcdir/check.t' \\ exec \$perl '$srcdir/check.pl' -s '$srcdir/check.t' \\
-p '$curdir/mksh' -C $check_categories \$*$tsts -p '$curdir/mksh' -C \$check_categories \$*$tsts
EOF EOF
chmod 755 test.sh chmod 755 test.sh
echo set -x >Rebuild.sh echo set -x >Rebuild.sh

32
check.t
View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.167 2008/04/01 16:26:42 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.168 2008/04/01 17:22:54 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -4283,14 +4283,12 @@ expected-stdout:
ohne ohne
: mit : mit
--- ---
name: utf8bom-2 name: utf8bom-2a
description: description:
Check that we can execute BOM-shebangs Check that we can execute BOM-shebangs
XXX if the OS can already execute them, we lose XXX if the OS can already execute them, we lose
note: cygwin execve(2) doesn't return to us with ENOEXEC, we lose note: cygwin execve(2) doesn't return to us with ENOEXEC, we lose
note: perl 5.004_04 on Linux 2.0 doesn't support Unicode, t4 fails category: pdksh,!os:cygwin,!os:uwin-nt,!oldish-perl
note: same for perl 5.003_02 on BSD/OS 3.1 and possibly others
category: pdksh,!os:cygwin,!os:uwin-nt
env-setup: !FOO=BAR! env-setup: !FOO=BAR!
stdin: stdin:
print '#!'"$__progname"'\nprint "a=$ENV{FOO}";' >t1 print '#!'"$__progname"'\nprint "a=$ENV{FOO}";' >t1
@ -4308,6 +4306,30 @@ expected-stdout:
a=BAR a=BAR
a=BAR a=BAR
--- ---
name: utf8bom-2b
description:
Check that we can execute BOM-shebangs
XXX if the OS can already execute them, we lose
category: pdksh,oldish-perl
env-setup: !FOO=BAR!
stdin:
print '#!'"$__progname"'\nprint "a=$ENV{FOO}";' >t1
print '#!'"$__progname"'\nprint "a=$ENV{FOO}";' >t2
print '#!'"$__perlname"'\nprint "a=$ENV{FOO}\n";' >t3
print '#!'"$__perlname"'\nprint "a=$ENV{FOO}\n";' >t4
chmod +x t?
./t1
./t2
./t3
./t4
expected-stdout:
a=/nonexistant{FOO}
a=/nonexistant{FOO}
a=BAR
a=BAR
expected-stderr-pattern:
/nrecogni.ed/
---
name: utf8bom-3 name: utf8bom-3
description: description:
Reading the UTF-8 BOM should enable the utf8-hack flag Reading the UTF-8 BOM should enable the utf8-hack flag