| Line | |
|---|
| 1 | # -*-perl-*-
|
|---|
| 2 |
|
|---|
| 3 | $description = 'Test the $(shell ...) function.';
|
|---|
| 4 |
|
|---|
| 5 | $details = '';
|
|---|
| 6 |
|
|---|
| 7 | # Test standard shell
|
|---|
| 8 | run_make_test('.PHONY: all
|
|---|
| 9 | OUT := $(shell echo hi)
|
|---|
| 10 | all: ; @echo $(OUT)
|
|---|
| 11 | ','','hi');
|
|---|
| 12 |
|
|---|
| 13 | # Test shells inside rules.
|
|---|
| 14 | run_make_test('.PHONY: all
|
|---|
| 15 | all: ; @echo $(shell echo hi)
|
|---|
| 16 | ','','hi');
|
|---|
| 17 |
|
|---|
| 18 | # Verify .SHELLSTATUS
|
|---|
| 19 | run_make_test('.PHONY: all
|
|---|
| 20 | PRE := $(.SHELLSTATUS)
|
|---|
| 21 | $(shell exit 0)
|
|---|
| 22 | OK := $(.SHELLSTATUS)
|
|---|
| 23 | $(shell exit 1)
|
|---|
| 24 | BAD := $(.SHELLSTATUS)
|
|---|
| 25 | all: ; @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
|
|---|
| 30 | if ($all_tests) {
|
|---|
| 31 | run_make_test(q!
|
|---|
| 32 | FOO := $(shell echo '#')
|
|---|
| 33 | foo: ; 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.
|
|---|
| 41 | run_make_test('
|
|---|
| 42 | export HI = $(shell echo hi)
|
|---|
| 43 | .PHONY: all
|
|---|
| 44 | all: ; @echo $$HI
|
|---|
| 45 | ','','hi');
|
|---|
| 46 |
|
|---|
| 47 | # Test shell errors in recipes including offset
|
|---|
| 48 | run_make_test('
|
|---|
| 49 | all:
|
|---|
| 50 | @echo hi
|
|---|
| 51 | $(shell ./basdfdfsed there)
|
|---|
| 52 | @echo there
|
|---|
| 53 | ',
|
|---|
| 54 | '', "#MAKE#: ./basdfdfsed: Command not found\nhi\nthere\n");
|
|---|
| 55 |
|
|---|
| 56 | 1;
|
|---|
| 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.