VirtualBox

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

最後變更 在這個檔案從3208是 3138,由 bird 提交於 7 年 前

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

  • 屬性 svn:eol-style 設為 LF
檔案大小: 1.3 KB
 
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:
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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