Changeset 503 for trunk/src/gmake/tests/scripts/variables
- Timestamp:
- Sep 15, 2006, 7:09:38 AM (19 years ago)
- Location:
- trunk/src/gmake/tests/scripts/variables
- Files:
-
- 2 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/tests/scripts/variables/SHELL
r282 r503 5 5 # Find the default value when SHELL is not set. On UNIX it will be /bin/sh, 6 6 # but on other platforms who knows? 7 $oshell = $ENV{SHELL};7 resetENV(); 8 8 delete $ENV{SHELL}; 9 $mshell = `echo 'all:;\@echo \$(SHELL)' | $make_ name-f-`;9 $mshell = `echo 'all:;\@echo \$(SHELL)' | $make_path -f-`; 10 10 chop $mshell; 11 11 12 12 # According to POSIX, the value of SHELL in the environment has no impact on 13 13 # the value in the makefile. 14 # Note %extraENV takes precedence over the default value for the shell. 14 15 15 $ ENV{SHELL} = '/dev/null';16 $extraENV{SHELL} = '/dev/null'; 16 17 run_make_test('all:;@echo "$(SHELL)"', '', $mshell); 17 18 … … 19 20 # exported to the subshell! I wanted to set SHELL to be $^X (perl) in the 20 21 # makefile, but make runs $(SHELL) -c 'commandline' and that doesn't work at 21 # all when $(SHELL) is perl :-/. So, we just add an extra initial / and hope22 # for the best on non-UNIX platforms :-/.22 # all when $(SHELL) is perl :-/. So, we just add an extra initial /./ which 23 # works well on UNIX and seems to work OK on at least some non-UNIX systems. 23 24 24 $ ENV{SHELL} = $mshell;25 $extraENV{SHELL} = $mshell; 25 26 26 run_make_test("SHELL := / $mshell\n".'27 run_make_test("SHELL := /./$mshell\n".' 27 28 all:;@echo "$(SHELL) $$SHELL" 28 ', '', "/ $mshell $mshell");29 ', '', "/./$mshell $mshell"); 29 30 30 31 # As a GNU make extension, if make's SHELL variable is explicitly exported, 31 32 # then we really _DO_ export it. 32 33 33 run_make_test("export SHELL := /$mshell\n".' 34 $extraENV{SHELL} = $mshell; 35 36 run_make_test("export SHELL := /./$mshell\n".' 34 37 all:;@echo "$(SHELL) $$SHELL" 35 ', '', "/ $mshell/$mshell");38 ', '', "/./$mshell /./$mshell"); 36 39 37 40 … … 39 42 # variable. 40 43 41 run_make_test("all: SHELL := /$mshell\n".' 44 $extraENV{SHELL} = $mshell; 45 46 run_make_test("all: SHELL := /./$mshell\n".' 42 47 all:;@echo "$(SHELL) $$SHELL" 43 ', '', "/ $mshell $mshell");48 ', '', "/./$mshell $mshell"); 44 49 45 run_make_test("all: export SHELL := /$mshell\n".' 50 $extraENV{SHELL} = $mshell; 51 52 run_make_test("all: export SHELL := /./$mshell\n".' 46 53 all:;@echo "$(SHELL) $$SHELL" 47 ', '', "/ $mshell $mshell");54 ', '', "/./$mshell $mshell"); 48 55 49 56 1; -
trunk/src/gmake/tests/scripts/variables/automatic
r285 r503 28 28 close(MAKEFILE); 29 29 30 # TEST # 1-- simple test30 # TEST #0 -- simple test 31 31 # ------- 32 32 … … 47 47 unlink(qw(foo.x bar.y baz.z)); 48 48 49 # TEST # 2-- test the SysV emulation of $$@ etc.49 # TEST #1 -- test the SysV emulation of $$@ etc. 50 50 # ------- 51 51 … … 55 55 print MAKEFILE "dir = $dir\n"; 56 56 print MAKEFILE <<'EOF'; 57 .SECONDEXPANSION: 57 58 .SUFFIXES: 58 59 .DEFAULT: ; @echo '$@' … … 79 80 &compare_output($answer, &get_logfile(1)); 80 81 81 # TEST # 3-- test for Savannah bug #12320.82 # TEST #2 -- test for Savannah bug #12320. 82 83 # 83 84 run_make_test(' … … 87 88 @echo $* 88 89 89 mbr.src: ; @: 90 mbr.src: ; @:', 91 '', 92 'mbr'); 90 93 91 ', 92 '', 93 'mbr 94 '); 94 # TEST #3 -- test for Savannah bug #8154 95 # Make sure that nonexistent prerequisites are listed in $?, since they are 96 # considered reasons for the target to be rebuilt. 97 # 98 # This was undone due to Savannah bug #16002. We'll re-do it in the next 99 # release. See Savannah bug #16051. 100 101 #touch('foo'); 102 # 103 #run_make_test(' 104 #foo: bar ; @echo "\$$? = $?" 105 #bar: ;', 106 # '', 107 # '$? = bar'); 108 # 109 #unlink('foo'); 95 110 96 111 1;
Note:
See TracChangeset
for help on using the changeset viewer.