VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/functions/shell

Last change on this file was 3138, checked in by bird, 7 years ago

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

  • Property svn:eol-style set to LF
File size: 1.3 KB
Line 
1# -*-perl-*-
2
3$description = 'Test the $(shell ...) function.';
4
5$details = '';
6
7# Test standard shell
8run_make_test('.PHONY: all
9OUT := $(shell echo hi)
10all: ; @echo $(OUT)
11 ','','hi');
12
13# Test shells inside rules.
14run_make_test('.PHONY: all
15all: ; @echo $(shell echo hi)
16 ','','hi');
17
18# Verify .SHELLSTATUS
19run_make_test('.PHONY: all
20PRE := $(.SHELLSTATUS)
21$(shell exit 0)
22OK := $(.SHELLSTATUS)
23$(shell exit 1)
24BAD := $(.SHELLSTATUS)
25all: ; @echo PRE=$(PRE) OK=$(OK) BAD=$(BAD)
26 ','','PRE= OK=0 BAD=1');
27
28
29# Test unescaped comment characters in shells. Savannah bug #20513
30if ($all_tests) {
31 run_make_test(q!
32FOO := $(shell echo '#')
33foo: ; echo '$(FOO)'
34!,
35 '', "#\n");
36}
37
38# Test shells inside exported environment variables.
39# This is the test that fails if we try to put make exported variables into
40# the environment for a $(shell ...) call.
41run_make_test('
42export HI = $(shell echo hi)
43.PHONY: all
44all: ; @echo $$HI
45 ','','hi');
46
47# Test shell errors in recipes including offset
48run_make_test('
49all:
50 @echo hi
51 $(shell ./basdfdfsed there)
52 @echo there
53',
54 '', "#MAKE#: ./basdfdfsed: Command not found\nhi\nthere\n");
55
561;
57
58### Local Variables:
59### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
60### End:
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette