… and $__perlname (for perl5 ipv perl, etc.)
This commit is contained in:
parent
c2f4ffea0b
commit
4738940ded
9
check.pl
9
check.pl
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.pl,v 1.16 2008/04/01 16:01:45 tg Exp $
|
# $MirOS: src/bin/mksh/check.pl,v 1.17 2008/04/01 16:26:42 tg Exp $
|
||||||
# $OpenBSD: th,v 1.12 2005/05/28 04:53:47 millert Exp $
|
# $OpenBSD: th,v 1.12 2005/05/28 04:53:47 millert Exp $
|
||||||
#-
|
#-
|
||||||
# Example test:
|
# Example test:
|
||||||
@ -58,6 +58,7 @@
|
|||||||
# the test harness).
|
# the test harness).
|
||||||
# ENV is set to /nonexistant.
|
# ENV is set to /nonexistant.
|
||||||
# __progname is set to the -p argument.
|
# __progname is set to the -p argument.
|
||||||
|
# __perlname is set to $^X (perlexe).
|
||||||
# file-setup mps Used to create files, directories
|
# file-setup mps Used to create files, directories
|
||||||
# and symlinks. First word is either
|
# and symlinks. First word is either
|
||||||
# file, dir or symlink; second word is
|
# file, dir or symlink; second word is
|
||||||
@ -130,6 +131,7 @@
|
|||||||
|
|
||||||
use POSIX qw(EINTR);
|
use POSIX qw(EINTR);
|
||||||
use Getopt::Std;
|
use Getopt::Std;
|
||||||
|
use Config;
|
||||||
|
|
||||||
$os = defined $^O ? $^O : 'unknown';
|
$os = defined $^O ? $^O : 'unknown';
|
||||||
|
|
||||||
@ -236,6 +238,11 @@ foreach $env (('USER', 'LOGNAME', 'HOME', 'PATH', 'SHELL')) {
|
|||||||
$new_env{$env} = $ENV{$env} if defined $ENV{$env};
|
$new_env{$env} = $ENV{$env} if defined $ENV{$env};
|
||||||
}
|
}
|
||||||
$new_env{'ENV'} = '/nonexistant';
|
$new_env{'ENV'} = '/nonexistant';
|
||||||
|
if (($^O eq 'VMS') || ($Config{perlpath} =~ m/$Config{_exe}$/i)) {
|
||||||
|
$new_env{'__perlname'} = $Config{perlpath};
|
||||||
|
} else {
|
||||||
|
$new_env{'__perlname'} = $Config{perlpath} . $Config{_exe};
|
||||||
|
}
|
||||||
if (defined $opt_e) {
|
if (defined $opt_e) {
|
||||||
# XXX need a way to allow many -e arguments...
|
# XXX need a way to allow many -e arguments...
|
||||||
if ($opt_e =~ /^([a-zA-Z_]\w*)(|=(.*))$/) {
|
if ($opt_e =~ /^([a-zA-Z_]\w*)(|=(.*))$/) {
|
||||||
|
13
check.t
13
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.166 2008/04/01 16:12:18 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.167 2008/04/01 16:26:42 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 $
|
||||||
@ -41,6 +41,13 @@ stdin:
|
|||||||
expected-stdout:
|
expected-stdout:
|
||||||
<fnord>
|
<fnord>
|
||||||
---
|
---
|
||||||
|
name: selftest-env
|
||||||
|
description:
|
||||||
|
Just output the environment variables set (always fails)
|
||||||
|
category: disabled
|
||||||
|
stdin:
|
||||||
|
set
|
||||||
|
---
|
||||||
name: alias-1
|
name: alias-1
|
||||||
description:
|
description:
|
||||||
Check that recursion is detected/avoided in aliases.
|
Check that recursion is detected/avoided in aliases.
|
||||||
@ -4288,8 +4295,8 @@ env-setup: !FOO=BAR!
|
|||||||
stdin:
|
stdin:
|
||||||
print '#!'"$__progname"'\nprint "a=$ENV{FOO}";' >t1
|
print '#!'"$__progname"'\nprint "a=$ENV{FOO}";' >t1
|
||||||
print '#!'"$__progname"'\nprint "a=$ENV{FOO}";' >t2
|
print '#!'"$__progname"'\nprint "a=$ENV{FOO}";' >t2
|
||||||
print '#!/usr/bin/env perl\nprint "a=$ENV{FOO}\n";' >t3
|
print '#!'"$__perlname"'\nprint "a=$ENV{FOO}\n";' >t3
|
||||||
print '#!/usr/bin/env perl\nprint "a=$ENV{FOO}\n";' >t4
|
print '#!'"$__perlname"'\nprint "a=$ENV{FOO}\n";' >t4
|
||||||
chmod +x t?
|
chmod +x t?
|
||||||
./t1
|
./t1
|
||||||
./t2
|
./t2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user