summaryrefslogtreecommitdiff
path: root/tests/scripts/variables
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-07-12 04:35:13 +0000
committerPaul Smith <psmith@gnu.org>2005-07-12 04:35:13 +0000
commit1e9dc3ce45ac44ea51292ca964b52ce47fee3ad3 (patch)
tree8bec287893a5b2fb441be612fbac4d64b8d8c8b2 /tests/scripts/variables
parent0e30f46a624803455dcc74acf9a333666467d253 (diff)
downloadgunmake-1e9dc3ce45ac44ea51292ca964b52ce47fee3ad3.tar.gz
Various minor updates and code cleanups.
Diffstat (limited to 'tests/scripts/variables')
-rw-r--r--tests/scripts/variables/SHELL13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/scripts/variables/SHELL b/tests/scripts/variables/SHELL
index 93c1872..adfa5b1 100644
--- a/tests/scripts/variables/SHELL
+++ b/tests/scripts/variables/SHELL
@@ -4,15 +4,16 @@ $description = "Test proper handling of SHELL.";
# Find the default value when SHELL is not set. On UNIX it will be /bin/sh,
# but on other platforms who knows?
-$oshell = $ENV{SHELL};
+resetENV();
delete $ENV{SHELL};
$mshell = `echo 'all:;\@echo \$(SHELL)' | $make_path -f-`;
chop $mshell;
# According to POSIX, the value of SHELL in the environment has no impact on
# the value in the makefile.
+# Note %extraENV takes precedence over the default value for the shell.
-$ENV{SHELL} = '/dev/null';
+$extraENV{SHELL} = '/dev/null';
run_make_test('all:;@echo "$(SHELL)"', '', $mshell);
# According to POSIX, any value of SHELL set in the makefile should _NOT_ be
@@ -21,7 +22,7 @@ run_make_test('all:;@echo "$(SHELL)"', '', $mshell);
# all when $(SHELL) is perl :-/. So, we just add an extra initial / and hope
# for the best on non-UNIX platforms :-/.
-$ENV{SHELL} = $mshell;
+$extraENV{SHELL} = $mshell;
run_make_test("SHELL := /$mshell\n".'
all:;@echo "$(SHELL) $$SHELL"
@@ -30,6 +31,8 @@ all:;@echo "$(SHELL) $$SHELL"
# As a GNU make extension, if make's SHELL variable is explicitly exported,
# then we really _DO_ export it.
+$extraENV{SHELL} = $mshell;
+
run_make_test("export SHELL := /$mshell\n".'
all:;@echo "$(SHELL) $$SHELL"
', '', "/$mshell /$mshell");
@@ -38,10 +41,14 @@ all:;@echo "$(SHELL) $$SHELL"
# Test out setting of SHELL, both exported and not, as a target-specific
# variable.
+$extraENV{SHELL} = $mshell;
+
run_make_test("all: SHELL := /$mshell\n".'
all:;@echo "$(SHELL) $$SHELL"
', '', "/$mshell $mshell");
+$extraENV{SHELL} = $mshell;
+
run_make_test("all: export SHELL := /$mshell\n".'
all:;@echo "$(SHELL) $$SHELL"
', '', "/$mshell $mshell");